Commit 9d8d0f29 authored by Mark Tyneway's avatar Mark Tyneway Committed by GitHub

Merge pull request #2868 from ethereum-optimism/develop

Merge develop into master
parents 6552bdca 5a12c635
---
'@eth-optimism/contracts-bedrock': patch
---
Enable hardhat style buildinfo
---
'@eth-optimism/contracts-bedrock': patch
---
Make the Portal upgradeable
---
'@eth-optimism/indexer': patch
---
Fix a couple semgrep issues
---
'@eth-optimism/contracts-bedrock': patch
---
Add `OptimismPortal.isOutputFinalized`
---
'@eth-optimism/indexer': patch
---
Deduplicate some l2geth and geth utils
---
'@eth-optimism/contracts-bedrock': patch
---
correct l33t sp34k in toCodeAddrr
---
'@eth-optimism/contracts-bedrock': patch
---
Add deployer docker image
---
'@eth-optimism/hardhat-node': minor
---
Correct configuration file behavior
---
'@eth-optimism/indexer': patch
---
Use op-bindings package for address manager
---
'@eth-optimism/contracts-periphery': patch
---
Deploy Drippie to mainnet
---
'@eth-optimism/contracts-bedrock': patch
---
Optimize buildinfo support, only build through hardhat interface
version: 2.1 version: 2.1
orbs:
node: circleci/node@5.0.2
executors:
go-builder:
docker:
- image: ethereumoptimism/go-builder:latest
commands:
go-lint-test:
parameters:
working_directory:
description: Working directory
type: string
steps:
- checkout
- run:
name: Lint
command: golangci-lint run -E goimports -E sqlclosecheck -E bodyclose -E asciicheck ./...
working_directory: <<parameters.working_directory>>
- run:
name: Test
command: |
mkdir -p /test-results
gotestsum --junitfile /test-results/tests.xml
working_directory: <<parameters.working_directory>>
- store_test_results:
path: /test-results
jobs: jobs:
go-lint-test:
parameters:
working_directory:
description: Working directory
type: string
docker:
- image: ethereumoptimism/go-builder:latest
- image: cimg/postgres:14.1
steps:
- go-lint-test:
working_directory: <<parameters.working_directory>>
go-lint-test-build:
parameters:
binary_name:
description: Binary name to build
type: string
working_directory:
description: Working directory
type: string
docker:
- image: ethereumoptimism/go-builder:latest
- image: cimg/postgres:14.1
steps:
- go-lint-test:
working_directory: <<parameters.working_directory>>
- run:
name: Build
command: make <<parameters.binary_name>>
working_directory: <<parameters.working_directory>>
yarn-monorepo: yarn-monorepo:
docker: docker:
- image: ethereumoptimism/js-builder:latest - image: ethereumoptimism/ci-builder:latest
resource_class: xlarge
steps: steps:
- restore_cache: - restore_cache:
keys: keys:
- v2-cache-source-{{ .Branch }}-{{ .Revision }} - v2-cache-source-{{ .Branch }}-{{ .Revision }}
- v2-cache-source-{{ .Branch }} - v2-cache-source-{{ .Branch }}
- checkout - checkout
- run:
name: Check if we should run
command: |
CHANGED=$(check-changed "packages/")
if [[ "$CHANGED" = "FALSE" ]]; then
circleci step halt
fi
- save_cache: - save_cache:
key: v2-cache-source-{{ .Branch }}-{{ .Revision }} key: v2-cache-source-{{ .Branch }}-{{ .Revision }}
paths: paths:
...@@ -105,221 +53,6 @@ jobs: ...@@ -105,221 +53,6 @@ jobs:
paths: paths:
- "." - "."
contracts-slither:
docker:
- image: ethereumoptimism/js-builder:latest
steps:
- restore_cache:
keys:
- v2-cache-yarn-build-{{ .Revision }}
- checkout
- run:
name: Run Slither
command: yarn test:slither
working_directory: packages/contracts
contracts-periphery-slither:
docker:
- image: ethereumoptimism/js-builder:latest
steps:
- restore_cache:
keys:
- v2-cache-yarn-build-{{ .Revision }}
- checkout
- run:
name: Run Slither
command: yarn test:slither
working_directory: packages/contracts-periphery
contracts-tests:
docker:
- image: ethereumoptimism/js-builder:latest
resource_class: xlarge
steps:
- restore_cache:
keys:
- v2-cache-yarn-build-{{ .Revision }}
- checkout
- run:
name: Lint
command: yarn lint:check
working_directory: packages/contracts
- run:
name: Check deployment docs
command: yarn autogen:markdown && git diff --exit-code
working_directory: packages/contracts
- run:
name: Slither
command: yarn test:slither
working_directory: packages/contracts
- run:
name: Test
command: yarn test:coverage
working_directory: packages/contracts
contracts-periphery-tests:
docker:
- image: ethereumoptimism/js-builder:latest
resource_class: xlarge
steps:
- restore_cache:
keys:
- v2-cache-yarn-build-{{ .Revision }}
- checkout
- run:
name: Lint
command: yarn lint:check
working_directory: packages/contracts-periphery
- run:
name: Slither
command: yarn test:slither
working_directory: packages/contracts
- run:
name: Test
command: yarn test:coverage
working_directory: packages/contracts-periphery
contracts-governance-tests:
docker:
- image: ethereumoptimism/js-builder:latest
resource_class: xlarge
steps:
- restore_cache:
keys:
- v2-cache-yarn-build-{{ .Revision }}
- checkout
- run:
name: Lint
command: yarn lint:check
working_directory: packages/contracts-governance
- run:
name: Test
command: yarn test
working_directory: packages/contracts-governance
dtl-tests:
docker:
- image: ethereumoptimism/js-builder:latest
steps:
- restore_cache:
keys:
- v2-cache-yarn-build-{{ .Revision }}
- checkout
- run:
name: Test
command: yarn test:coverage
working_directory: packages/data-transport-layer
geth-tests:
docker:
- image: ethereumoptimism/go-builder:latest
steps:
- checkout
- run:
name: Test
command: make test
working_directory: l2geth
depcheck:
docker:
- image: ethereumoptimism/js-builder:latest
steps:
- restore_cache:
keys:
- v2-cache-yarn-build-{{ .Revision }}
- checkout
# Note: The below needs to be manually configured whenever we
# add a new package to CI.
- run:
name: Check contracts
command: npx depcheck
working_directory: packages/contracts
- run:
name: Check contracts-periphery
command: npx depcheck
working_directory: packages/contracts-periphery
- run:
name: Check core-utils
command: npx depcheck
working_directory: packages/core-utils
- run:
name: Check data-transport-layer
command: npx depcheck
working_directory: packages/data-transport-layer
- run:
name: Check sdk
command: npx depcheck
working_directory: packages/sdk
- run:
name: Check integration-tests
command: npx depcheck
working_directory: integration-tests
bss-core-tests:
docker:
- image: ethereumoptimism/go-builder:latest
steps:
- checkout
- run:
name: Lint
command: golangci-lint run -E goimports -E sqlclosecheck -E bodyclose -E asciicheck ./...
working_directory: bss-core
- run:
name: Test
command: |
mkdir -p /test-results
gotestsum --junitfile /test-results/tests.xml
working_directory: bss-core
- store_test_results:
path: /test-results
integration-tests:
machine:
image: ubuntu-2004:202111-02
docker_layer_caching: true
environment:
DOCKER_BUILDKIT: 1
parallelism: 3
steps:
- checkout
- run:
name: Bring up the stack
command: |
docker-compose build --progress=plain
docker-compose up -d --scale replica_healthcheck=1
working_directory: ops
- run:
name: Wait for sequencer
command: bash scripts/wait-for-sequencer.sh
working_directory: ops
- run:
name: Run integration tests
command: |
circleci tests glob "../integration-tests/test/*.spec.ts" | circleci tests split | tee splits.txt
docker-compose run integration_tests $(cat splits.txt)
working_directory: ops
js-lint-test:
parameters:
package_name:
description: Package name
type: string
docker:
- image: ethereumoptimism/js-builder:latest
steps:
- restore_cache:
keys:
- v2-cache-yarn-build-{{ .Revision }}
- checkout
- run:
name: Lint
command: yarn lint:check
working_directory: packages/<<parameters.package_name>>
- run:
name: Test
command: yarn test:coverage
working_directory: packages/<<parameters.package_name>>
docker-publish: docker-publish:
environment: environment:
DOCKER_BUILDKIT: 1 DOCKER_BUILDKIT: 1
...@@ -349,45 +82,39 @@ jobs: ...@@ -349,45 +82,39 @@ jobs:
- run: - run:
name: Build with context name: Build with context
command: | command: |
docker build \ docker build \
$(echo -ne "<< parameters.docker_tags >>" | sed "s/,/\n/g" | sed -e 's/^/-t /' | tr '\n' ' ') \ $(echo -ne "<< parameters.docker_tags >>" | sed "s/,/\n/g" | sed -e 's/^/-t /' | tr '\n' ' ') \
-f <<parameters.docker_file>> \ -f <<parameters.docker_file>> \
--target <<parameters.target>> \ --target <<parameters.target>> \
<<parameters.docker_context>> <<parameters.docker_context>>
- unless: - unless:
condition: <<parameters.target>> condition: <<parameters.target>>
steps: steps:
- run: - run:
name: Build name: Build
command: | command: |
docker build \ docker build \
$(echo -ne "<< parameters.docker_tags >>" | sed "s/,/\n/g" | sed -e 's/^/-t /' | tr '\n' ' ') \ $(echo -ne "<< parameters.docker_tags >>" | sed "s/,/\n/g" | sed -e 's/^/-t /' | tr '\n' ' ') \
-f <<parameters.docker_file>> \ -f <<parameters.docker_file>> \
<<parameters.docker_context>> <<parameters.docker_context>>
- run: - run:
name: Publish name: Publish
command: | command: |
echo "$DOCKER_PASS" | docker login -u "$DOCKER_USERNAME" --password-stdin echo "$DOCKER_PASS" | docker login -u "$DOCKER_USERNAME" --password-stdin
docker push <<parameters.docker_tags>> docker push <<parameters.docker_tags>>
bedrock-markdown:
machine:
image: ubuntu-2004:202111-02
steps:
- checkout
- run:
name: markdown lint
command: |
docker run -v `pwd`:/workdir davidanson/markdownlint-cli2:0.4.0 "op-node/README.md" "./specs/**/*.md" "#**/node_modules"
- run:
name: link lint
command: |
docker run --init -it -v `pwd`:/input lycheeverse/lychee --verbose --no-progress --exclude-loopback --exclude twitter.com --exclude-mail /input/README.md "/input/specs/**/*.md" "/input/meta/**/*.md" "/input/op-node/**/*.md" || exit 0
contracts-bedrock-tests: contracts-bedrock-tests:
docker: docker:
- image: ethereumoptimism/js-builder:latest - image: ethereumoptimism/ci-builder:latest
resource_class: medium
steps: steps:
- run:
name: Check if we should run
command: |
CHANGED=$(check-changed "(contracts-bedrock|hardhat-deploy-config)")
if [[ "$CHANGED" = "FALSE" ]]; then
circleci step halt
fi
- restore_cache: - restore_cache:
keys: keys:
- v2-cache-yarn-build-{{ .Revision }} - v2-cache-yarn-build-{{ .Revision }}
...@@ -419,11 +146,51 @@ jobs: ...@@ -419,11 +146,51 @@ jobs:
command: make && git diff --exit-code command: make && git diff --exit-code
working_directory: op-bindings working_directory: op-bindings
js-lint-test:
parameters:
package_name:
description: Package name
type: string
dependencies:
description: Regex matching dependent packages
type: string
default: this-package-does-not-exist
docker:
- image: ethereumoptimism/ci-builder:latest
resource_class: large
steps:
- restore_cache:
keys:
- v2-cache-yarn-build-{{ .Revision }}
- checkout
- run:
name: Check if we should run
command: |
CHANGED=$(check-changed "(packages/<<parameters.package_name>>|packages/<<parameters.dependencies>>)")
if [[ "$CHANGED" = "FALSE" ]]; then
circleci step halt
fi
- run:
name: Lint
command: yarn lint:check
working_directory: packages/<<parameters.package_name>>
- run:
name: Test
command: yarn test:coverage
working_directory: packages/<<parameters.package_name>>
bedrock-go-tests: bedrock-go-tests:
docker: docker:
- image: ethereumoptimism/go-builder:latest - image: ethereumoptimism/ci-builder:latest
steps: steps:
- checkout - checkout
- run:
name: Check if we should run
command: |
CHANGED=$(check-changed "op-(batcher|bindings|e2e|node|proposer)")
if [[ "$CHANGED" = "FALSE" ]]; then
circleci step halt
fi
- run: - run:
name: lint op-bindings name: lint op-bindings
command: | command: |
...@@ -474,41 +241,189 @@ jobs: ...@@ -474,41 +241,189 @@ jobs:
working_directory: op-e2e working_directory: op-e2e
- store_test_results: - store_test_results:
path: /test-results path: /test-results
- run:
command: echo "Done."
bedrock-markdown:
machine:
image: ubuntu-2004:202111-02
steps:
- checkout
- run:
name: markdown lint
command: |
docker run -v `pwd`:/workdir davidanson/markdownlint-cli2:0.4.0 "op-node/README.md" "./specs/**/*.md" "#**/node_modules"
- run:
name: link lint
command: |
docker run --init -it -v `pwd`:/input lycheeverse/lychee --verbose --no-progress --exclude-loopback --exclude twitter.com --exclude-mail /input/README.md "/input/specs/**/*.md" "/input/meta/**/*.md" "/input/op-node/**/*.md" || exit 0
fuzz-op-node: fuzz-op-node:
docker: docker:
- image: ethereumoptimism/go-builder:latest - image: ethereumoptimism/ci-builder:latest
steps: steps:
- checkout - checkout
- run:
name: Check if we should run
command: |
CHANGED=$(check-changed "op-node")
if [[ "$CHANGED" = "FALSE" ]]; then
circleci step halt
fi
- run: - run:
name: Fuzz name: Fuzz
command: make fuzz command: make fuzz
working_directory: op-node working_directory: op-node
bedrock-integration-tests: depcheck:
docker:
- image: ethereumoptimism/ci-builder:latest
steps:
- restore_cache:
keys:
- v2-cache-yarn-build-{{ .Revision }}
- checkout
- run:
name: Check if we should run
command: |
CHANGED=$(check-changed "packages/")
if [[ "$CHANGED" = "FALSE" ]]; then
circleci step halt
fi
# Note: The below needs to be manually configured whenever we
# add a new package to CI.
- run:
name: Check contracts
command: npx depcheck
working_directory: packages/contracts
- run:
name: Check contracts-periphery
command: npx depcheck
working_directory: packages/contracts-periphery
- run:
name: Check core-utils
command: npx depcheck
working_directory: packages/core-utils
- run:
name: Check data-transport-layer
command: npx depcheck
working_directory: packages/data-transport-layer
- run:
name: Check sdk
command: npx depcheck
working_directory: packages/sdk
- run:
name: Check integration-tests
command: npx depcheck
working_directory: integration-tests
go-lint-test-build:
parameters:
binary_name:
description: Binary name to build
type: string
working_directory:
description: Working directory
type: string
build:
description: Whether or not to build the binary
type: boolean
default: true
dependencies:
description: Regex matching dependent packages
type: string
default: this-package-does-not-exist
docker:
- image: ethereumoptimism/ci-builder:latest
- image: cimg/postgres:14.1
steps:
- checkout
- run:
name: Check if we should run
command: |
CHANGED=$(check-changed "(<<parameters.working_directory>>|<<parameters.dependencies>>)")
echo $CHANGED
if [[ "$CHANGED" = "FALSE" ]]; then
circleci step halt
fi
- run:
name: Lint
command: golangci-lint run -E goimports,sqlclosecheck,bodyclose,asciicheck,misspell ./...
working_directory: <<parameters.working_directory>>
- store_test_results:
path: /test-results
- run:
name: Test
command: |
mkdir -p /test-results
gotestsum --junitfile /test-results/tests.xml
working_directory: <<parameters.working_directory>>
- when:
condition:
equal: [ true, <<parameters.build>> ]
steps:
- run:
name: Build
command: make <<parameters.binary_name>>
working_directory: <<parameters.working_directory>>
geth-tests:
docker:
- image: ethereumoptimism/ci-builder:latest
steps:
- checkout
- run:
name: Check if we should run
command: |
CHANGED=$(check-changed "l2geth")
if [[ "$CHANGED" = "FALSE" ]]; then
circleci step halt
fi
- run:
name: Test
command: make test
working_directory: l2geth
integration-tests:
machine: machine:
image: ethereumoptimism/js-builder:latest image: ubuntu-2004:202201-01
docker_layer_caching: true docker_layer_caching: true
environment:
DOCKER_BUILDKIT: 1
parallelism: 3
steps: steps:
- checkout - checkout
- node/install:
install-yarn: true
node-version: '16.13'
- run: - run:
name: build typescript name: Check if we should run
command: make build-ts command: |
CHANGED=$(bash ./ops/docker/ci-builder/check-changed.sh "(l2geth|common-ts|contracts|core-utils|message-relayer|data-transport-layer|replica-healthcheck|sdk|batch-submitter|gas-oracle|bss-core|integration-tests)")
if [[ "$CHANGED" = "FALSE" ]]; then
circleci step halt
fi
- run: - run:
name: start devnet name: Bring up the stack
command: make devnet-up command: |
docker-compose build --progress=plain
docker-compose up -d --scale replica_healthcheck=1
working_directory: ops
- run:
name: Wait for sequencer
command: bash scripts/wait-for-sequencer.sh
working_directory: ops
- run: - run:
name: run itests name: Run integration tests
command: make test-integration command: |
circleci tests glob "../integration-tests/test/*.spec.ts" | circleci tests split | tee splits.txt
docker-compose run integration_tests $(cat splits.txt)
working_directory: ops
- run:
command: echo "Done."
semgrep-scan: semgrep-scan:
parameters: parameters:
diff_branch: diff_branch:
type: string type: string
default: develop default: develop
environment: environment:
TEMPORARY_BASELINE_REF: << parameters.diff_branch >> TEMPORARY_BASELINE_REF: << parameters.diff_branch >>
SEMGREP_REPO_URL: << pipeline.project.git_url >> SEMGREP_REPO_URL: << pipeline.project.git_url >>
...@@ -525,20 +440,20 @@ jobs: ...@@ -525,20 +440,20 @@ jobs:
- checkout - checkout
- unless: - unless:
condition: condition:
equal: [ "develop", << pipeline.git.branch >>] equal: [ "develop", << pipeline.git.branch >> ]
steps: steps:
- run: - run:
# Scan changed files in PRs, block on new issues only (existing issues ignored) # Scan changed files in PRs, block on new issues only (existing issues ignored)
# Do a full scan when scanning develop, otherwise do an incremental scan. # Do a full scan when scanning develop, otherwise do an incremental scan.
name: "Conditionally set BASELINE env var" name: "Conditionally set BASELINE env var"
command: | command: |
echo 'export SEMGREP_BASELINE_REF=${TEMPORARY_BASELINE_REF}' >> $BASH_ENV echo 'export SEMGREP_BASELINE_REF=${TEMPORARY_BASELINE_REF}' >> $BASH_ENV
- run: - run:
name: "Set environment variables" # for PR comments and in-app hyperlinks to findings name: "Set environment variables" # for PR comments and in-app hyperlinks to findings
command: | command: |
echo 'export SEMGREP_PR_ID=${CIRCLE_PULL_REQUEST##*/}' >> $BASH_ENV echo 'export SEMGREP_PR_ID=${CIRCLE_PULL_REQUEST##*/}' >> $BASH_ENV
echo 'export SEMGREP_JOB_URL=$CIRCLE_BUILD_URL' >> $BASH_ENV echo 'export SEMGREP_JOB_URL=$CIRCLE_BUILD_URL' >> $BASH_ENV
echo 'export SEMGREP_REPO_NAME=$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME' >> $BASH_ENV echo 'export SEMGREP_REPO_NAME=$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME' >> $BASH_ENV
- run: - run:
name: "Semgrep scan" name: "Semgrep scan"
command: semgrep ci command: semgrep ci
...@@ -546,86 +461,110 @@ jobs: ...@@ -546,86 +461,110 @@ jobs:
workflows: workflows:
main: main:
jobs: jobs:
- semgrep-scan
- yarn-monorepo - yarn-monorepo
- bedrock-go-tests - js-lint-test:
- bedrock-markdown name: common-ts-tests
- fuzz-op-node package_name: common-ts
- go-lint-test-build:
name: batch-submitter-tests
binary_name: batch-submitter
working_directory: batch-submitter
- go-lint-test-build:
name: proxyd-tests
binary_name: proxyd
working_directory: proxyd
- go-lint-test-build:
name: teleportr-tests
binary_name: teleportr
working_directory: teleportr
- go-lint-test-build:
name: gas-oracle-tests
binary_name: gas-oracle
working_directory: gas-oracle
- go-lint-test-build:
name: indexer-tests
binary_name: indexer
working_directory: indexer
- go-lint-test:
name: bss-core-tests
working_directory: bss-core
- contracts-tests:
requires: requires:
- yarn-monorepo - yarn-monorepo
- contracts-periphery-tests: - js-lint-test:
name: contracts-tests
package_name: contracts
dependencies: hardhat-deploy-config
requires: requires:
- yarn-monorepo - yarn-monorepo
- contracts-bedrock-tests: - js-lint-test:
name: core-utils-tests
package_name: core-utils
requires: requires:
- yarn-monorepo - yarn-monorepo
- contracts-governance-tests: - contracts-bedrock-tests:
requires: requires:
- yarn-monorepo - yarn-monorepo
- js-lint-test: - js-lint-test:
name: dtl-tests name: contracts-governance-tests
package_name: data-transport-layer package_name: contracts-governance
dependencies: "(core-utils|sdk)"
requires: requires:
- yarn-monorepo - yarn-monorepo
- js-lint-test: - js-lint-test:
name: core-utils-tests name: contracts-periphery-tests
package_name: core-utils package_name: contracts-periphery
dependencies: "(contracts|contracts-bedrock|core-utils|hardhat-deploy-config)"
requires: requires:
- yarn-monorepo - yarn-monorepo
- js-lint-test: - js-lint-test:
name: sdk-tests name: dtl-tests
package_name: sdk package_name: data-transport-layer
dependencies: "(common-ts|contracts|core-utils)"
requires: requires:
- yarn-monorepo - yarn-monorepo
- js-lint-test: - js-lint-test:
name: fault-detector-tests name: drippie-mon-tests
package_name: fault-detector package_name: drippie-mon
dependencies: "(common-ts|contracts-periphery|core-utils|sdk)"
requires: requires:
- yarn-monorepo - yarn-monorepo
- js-lint-test: - js-lint-test:
name: drippie-mon-tests name: fault-detector-tests
package_name: drippie-mon package_name: fault-detector
dependencies: "(common-ts|contracts|core-utils|sdk)"
requires: requires:
- yarn-monorepo - yarn-monorepo
- js-lint-test: - js-lint-test:
name: message-relayer-tests name: message-relayer-tests
package_name: message-relayer package_name: message-relayer
dependencies: "(common-ts|core-utils|sdk)"
requires: requires:
- yarn-monorepo - yarn-monorepo
- js-lint-test: - js-lint-test:
name: replica-healthcheck-tests name: replica-healthcheck-tests
package_name: replica-healthcheck package_name: replica-healthcheck
dependencies: "(common-ts|core-utils)"
requires:
- yarn-monorepo
- js-lint-test:
name: sdk-tests
package_name: sdk
dependencies: "(contracts|core-utils)"
requires: requires:
- yarn-monorepo - yarn-monorepo
- depcheck: - depcheck:
requires: requires:
- yarn-monorepo - yarn-monorepo
- bedrock-go-tests
- fuzz-op-node
- bedrock-markdown
- go-lint-test-build:
name: batch-submitter-tests
binary_name: batch-submitter
working_directory: batch-submitter
dependencies: bss-core
- go-lint-test-build:
name: proxyd-tests
binary_name: proxyd
working_directory: proxyd
- go-lint-test-build:
name: teleportr-tests
binary_name: teleportr
working_directory: teleportr
dependencies: bss-core
- go-lint-test-build:
name: gas-oracle-tests
binary_name: gas-oracle
working_directory: gas-oracle
- go-lint-test-build:
name: indexer-tests
binary_name: indexer
working_directory: indexer
- go-lint-test-build:
name: bss-core-tests
binary_name: bss-core
working_directory: bss-core
build: false
- geth-tests - geth-tests
- integration-tests - integration-tests
- semgrep-scan
nightly: nightly:
triggers: triggers:
......
...@@ -21,6 +21,7 @@ jobs: ...@@ -21,6 +21,7 @@ jobs:
drippie-mon: ${{ steps.packages.outputs.drippie-mon }} drippie-mon: ${{ steps.packages.outputs.drippie-mon }}
data-transport-layer: ${{ steps.packages.outputs.data-transport-layer }} data-transport-layer: ${{ steps.packages.outputs.data-transport-layer }}
contracts: ${{ steps.packages.outputs.contracts }} contracts: ${{ steps.packages.outputs.contracts }}
contracts-bedrock: ${{ steps.packages.outputs.contracts-bedrock }}
gas-oracle: ${{ steps.packages.outputs.gas-oracle }} gas-oracle: ${{ steps.packages.outputs.gas-oracle }}
replica-healthcheck: ${{ steps.packages.outputs.replica-healthcheck }} replica-healthcheck: ${{ steps.packages.outputs.replica-healthcheck }}
hardhat-node: ${{ steps.packages.outputs.hardhat-node }} hardhat-node: ${{ steps.packages.outputs.hardhat-node }}
...@@ -311,6 +312,33 @@ jobs: ...@@ -311,6 +312,33 @@ jobs:
push: true push: true
tags: ethereumoptimism/deployer:${{ needs.canary-publish.outputs.canary-docker-tag }} tags: ethereumoptimism/deployer:${{ needs.canary-publish.outputs.canary-docker-tag }}
contracts-bedrock:
name: Publish deployer-bedrock Version ${{ needs.canary-publish.outputs.canary-docker-tag }}
needs: canary-publish
if: needs.canary-publish.outputs.contracts-bedrock != ''
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_ACCESS_TOKEN_USERNAME }}
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN_SECRET }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./ops/docker/Dockerfile.packages
target: deployer-bedrock
push: true
tags: ethereumoptimism/deployer-bedrock:${{ needs.canary-publish.outputs.canary-docker-tag }}
integration_tests: integration_tests:
name: Publish Integration tests ${{ needs.canary-publish.outputs.integration-tests }} name: Publish Integration tests ${{ needs.canary-publish.outputs.integration-tests }}
needs: canary-publish needs: canary-publish
......
...@@ -17,6 +17,7 @@ jobs: ...@@ -17,6 +17,7 @@ jobs:
drippie-mon: ${{ steps.packages.outputs.drippie-mon }} drippie-mon: ${{ steps.packages.outputs.drippie-mon }}
data-transport-layer: ${{ steps.packages.outputs.data-transport-layer }} data-transport-layer: ${{ steps.packages.outputs.data-transport-layer }}
contracts: ${{ steps.packages.outputs.contracts }} contracts: ${{ steps.packages.outputs.contracts }}
contracts-bedrock: ${{ steps.packages.outputs.contracts-bedrock }}
gas-oracle: ${{ steps.packages.outputs.gas-oracle }} gas-oracle: ${{ steps.packages.outputs.gas-oracle }}
replica-healthcheck: ${{ steps.packages.outputs.replica-healthcheck }} replica-healthcheck: ${{ steps.packages.outputs.replica-healthcheck }}
proxyd: ${{ steps.packages.outputs.proxyd }} proxyd: ${{ steps.packages.outputs.proxyd }}
...@@ -454,6 +455,33 @@ jobs: ...@@ -454,6 +455,33 @@ jobs:
push: true push: true
tags: ethereumoptimism/deployer:${{ needs.release.outputs.contracts }},ethereumoptimism/deployer:latest tags: ethereumoptimism/deployer:${{ needs.release.outputs.contracts }},ethereumoptimism/deployer:latest
contracts-bedrock:
name: Publish deployer-bedrock Version ${{ needs.release.outputs.contracts-bedrock }}
needs: release
if: needs.release.outputs.contracts != ''
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_ACCESS_TOKEN_USERNAME }}
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN_SECRET }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./ops/docker/Dockerfile.packages
target: deployer-bedrock
push: true
tags: ethereumoptimism/deployer-bedrock:${{ needs.release.outputs.contracts-bedrock }},ethereumoptimism/deployer-bedrock:latest
integration_tests: integration_tests:
name: Publish Integration tests ${{ needs.release.outputs.integration-tests }} name: Publish Integration tests ${{ needs.release.outputs.integration-tests }}
needs: release needs: release
......
...@@ -90,7 +90,7 @@ func GenSequencerBatchParams( ...@@ -90,7 +90,7 @@ func GenSequencerBatchParams(
) )
// Iterate over the batch elements, grouping the elements according to // Iterate over the batch elements, grouping the elements according to
// the following critera: // the following criteria:
// - All txs in the same group must have the same timestamp. // - All txs in the same group must have the same timestamp.
// - All sequencer txs in the same group must have the same block number. // - All sequencer txs in the same group must have the same block number.
// - If sequencer txs exist in a group, they must come before all // - If sequencer txs exist in a group, they must come before all
......
...@@ -179,7 +179,7 @@ type AppendSequencerBatchParams struct { ...@@ -179,7 +179,7 @@ type AppendSequencerBatchParams struct {
// Contexts aggregates redundant L1 block numbers and L1 timestamps for // Contexts aggregates redundant L1 block numbers and L1 timestamps for
// the txns encoded in the Tx slice. Further, they specify consecutive // the txns encoded in the Tx slice. Further, they specify consecutive
// tx windows in Txs and implicitly allow one to compute how many // tx windows in Txs and implicitly allow one to compute how many
// (ommitted) queued txs are in a given window. // (omitted) queued txs are in a given window.
Contexts []BatchContext Contexts []BatchContext
// Txs contains all sequencer txs that will be recorded in the L1 CTC // Txs contains all sequencer txs that will be recorded in the L1 CTC
...@@ -192,7 +192,7 @@ type AppendSequencerBatchParams struct { ...@@ -192,7 +192,7 @@ type AppendSequencerBatchParams struct {
// - total_elements_to_append: 3 bytes // - total_elements_to_append: 3 bytes
// - num_contexts: 3 bytes // - num_contexts: 3 bytes
// - num_contexts * batch_context: num_contexts * 16 bytes // - num_contexts * batch_context: num_contexts * 16 bytes
// - [num txs ommitted] // - [num txs omitted]
// - tx_len: 3 bytes // - tx_len: 3 bytes
// - tx_bytes: tx_len bytes // - tx_bytes: tx_len bytes
// //
...@@ -292,7 +292,7 @@ func (p *AppendSequencerBatchParams) Serialize( ...@@ -292,7 +292,7 @@ func (p *AppendSequencerBatchParams) Serialize(
// - total_elements_to_append: 3 bytes // - total_elements_to_append: 3 bytes
// - num_contexts: 3 bytes // - num_contexts: 3 bytes
// - num_contexts * batch_context: num_contexts * 16 bytes // - num_contexts * batch_context: num_contexts * 16 bytes
// - [num txs ommitted] // - [num txs omitted]
// - tx_len: 3 bytes // - tx_len: 3 bytes
// - tx_bytes: tx_len bytes // - tx_bytes: tx_len bytes
func (p *AppendSequencerBatchParams) Read(r io.Reader) error { func (p *AppendSequencerBatchParams) Read(r io.Reader) error {
...@@ -349,7 +349,7 @@ func (p *AppendSequencerBatchParams) Read(r io.Reader) error { ...@@ -349,7 +349,7 @@ func (p *AppendSequencerBatchParams) Read(r io.Reader) error {
r = bufio.NewReader(zr) r = bufio.NewReader(zr)
} }
// Deserialize any transactions. Since the number of txs is ommitted // Deserialize any transactions. Since the number of txs is omitted
// from the encoding, loop until the stream is consumed. // from the encoding, loop until the stream is consumed.
for { for {
var txLen uint64 var txLen uint64
......
...@@ -21,8 +21,8 @@ var ( ...@@ -21,8 +21,8 @@ var (
"or mnemonic+hdpath") "or mnemonic+hdpath")
) )
// ParseAddress parses an ETH addres from a hex string. This method will fail if // ParseAddress parses an ETH address from a hex string. This method will fail if
// the address is not a valid hexidecimal address. // the address is not a valid hexadecimal address.
func ParseAddress(address string) (common.Address, error) { func ParseAddress(address string) (common.Address, error) {
if common.IsHexAddress(address) { if common.IsHexAddress(address) {
return common.HexToAddress(address), nil return common.HexToAddress(address), nil
...@@ -101,7 +101,7 @@ func DerivePrivateKey(mnemonic, hdPath string) (*ecdsa.PrivateKey, error) { ...@@ -101,7 +101,7 @@ func DerivePrivateKey(mnemonic, hdPath string) (*ecdsa.PrivateKey, error) {
return crypto.ToECDSA(rawPrivKey) return crypto.ToECDSA(rawPrivKey)
} }
// ParsePrivateKeyStr parses a hexidecimal encoded private key, the encoding may // ParsePrivateKeyStr parses a hexadecimal encoded private key, the encoding may
// optionally have an "0x" prefix. // optionally have an "0x" prefix.
func ParsePrivateKeyStr(privKeyStr string) (*ecdsa.PrivateKey, error) { func ParsePrivateKeyStr(privKeyStr string) (*ecdsa.PrivateKey, error) {
hex := strings.TrimPrefix(privKeyStr, "0x") hex := strings.TrimPrefix(privKeyStr, "0x")
......
...@@ -45,7 +45,7 @@ var ( ...@@ -45,7 +45,7 @@ var (
) )
// TestParseAddress asserts that ParseAddress correctly parses 40-characater // TestParseAddress asserts that ParseAddress correctly parses 40-characater
// hexidecimal strings with optional 0x prefix into valid 20-byte addresses. // hexadecimal strings with optional 0x prefix into valid 20-byte addresses.
func TestParseAddress(t *testing.T) { func TestParseAddress(t *testing.T) {
tests := []struct { tests := []struct {
name string name string
...@@ -157,7 +157,7 @@ func TestDerivePrivateKey(t *testing.T) { ...@@ -157,7 +157,7 @@ func TestDerivePrivateKey(t *testing.T) {
} }
// TestParsePrivateKeyStr asserts that ParsePrivateKey properly parses // TestParsePrivateKeyStr asserts that ParsePrivateKey properly parses
// 64-character hexidecimal strings with optional 0x prefix into valid ECDSA // 64-character hexadecimal strings with optional 0x prefix into valid ECDSA
// private keys. // private keys.
func TestParsePrivateKeyStr(t *testing.T) { func TestParsePrivateKeyStr(t *testing.T) {
tests := []struct { tests := []struct {
...@@ -210,9 +210,9 @@ func TestParsePrivateKeyStr(t *testing.T) { ...@@ -210,9 +210,9 @@ func TestParsePrivateKeyStr(t *testing.T) {
// TestGetConfiguredPrivateKey asserts that GetConfiguredPrivateKey either: // TestGetConfiguredPrivateKey asserts that GetConfiguredPrivateKey either:
// 1) Derives the correct private key assuming the BIP39 mnemonic and BIP32 // 1) Derives the correct private key assuming the BIP39 mnemonic and BIP32
// derivation path are both present and the private key string is ommitted. // derivation path are both present and the private key string is omitted.
// 2) Parses the correct private key assuming only the private key string is // 2) Parses the correct private key assuming only the private key string is
// present, but the BIP39 mnemonic and BIP32 derivation path are ommitted. // present, but the BIP39 mnemonic and BIP32 derivation path are omitted.
func TestGetConfiguredPrivateKey(t *testing.T) { func TestGetConfiguredPrivateKey(t *testing.T) {
tests := []struct { tests := []struct {
name string name string
......
...@@ -10,7 +10,7 @@ import ( ...@@ -10,7 +10,7 @@ import (
type Base struct { type Base struct {
// subsystemName stores the name that will prefix all metrics. This can be // subsystemName stores the name that will prefix all metrics. This can be
// used by drivers to futher extend the core metrics and ensure they use the // used by drivers to further extend the core metrics and ensure they use the
// same prefix. // same prefix.
subsystemName string subsystemName string
......
...@@ -11,7 +11,7 @@ import ( ...@@ -11,7 +11,7 @@ import (
// SendState tracks information about the publication state of a given txn. In // SendState tracks information about the publication state of a given txn. In
// this context, a txn may correspond to multiple different txn hashes due to // this context, a txn may correspond to multiple different txn hashes due to
// varying gas prices, though we treat them all as the same logical txn. This // varying gas prices, though we treat them all as the same logical txn. This
// struct is primarly used to determine whether or not the txmgr should abort a // struct is primarily used to determine whether or not the txmgr should abort a
// given txn and retry with a higher nonce. // given txn and retry with a higher nonce.
type SendState struct { type SendState struct {
minedTxs map[common.Hash]struct{} minedTxs map[common.Hash]struct{}
......
...@@ -80,7 +80,7 @@ func TestSendStateMiningTxCancelsAbort(t *testing.T) { ...@@ -80,7 +80,7 @@ func TestSendStateMiningTxCancelsAbort(t *testing.T) {
} }
// TestSendStateReorgingTxResetsAbort asserts that unmining a tx does not // TestSendStateReorgingTxResetsAbort asserts that unmining a tx does not
// consider ErrNonceTooLow's prior to being mined when determing whether to // consider ErrNonceTooLow's prior to being mined when determine whether to
// abort. // abort.
func TestSendStateReorgingTxResetsAbort(t *testing.T) { func TestSendStateReorgingTxResetsAbort(t *testing.T) {
sendState := newSendState() sendState := newSendState()
......
...@@ -204,16 +204,18 @@ func (m *SimpleTxManager) Send( ...@@ -204,16 +204,18 @@ func (m *SimpleTxManager) Send(
wg.Add(1) wg.Add(1)
go sendTxAsync() go sendTxAsync()
tick := time.NewTicker(m.cfg.ResubmissionTimeout)
for { for {
select { select {
// Whenever a resubmission timeout has elapsed, bump the gas // Whenever a resubmission timeout has elapsed, bump the gas
// price and publish a new transaction. // price and publish a new transaction.
case <-time.After(m.cfg.ResubmissionTimeout): case <-tick.C:
// Avoid republishing if we are waiting for confirmation on an // Avoid republishing if we are waiting for confirmation on an
// existing tx. This is primarily an optimization to reduce the // existing tx. This is primarily an optimization to reduce the
// number of API calls we make, but also reduces the chances of // number of API calls we make, but also reduces the chances of
// getting a false postive reading for ShouldAbortImmediately. // getting a false positive reading for ShouldAbortImmediately.
if sendState.IsWaitingForConfirmation() { if sendState.IsWaitingForConfirmation() {
continue continue
} }
......
...@@ -37,7 +37,7 @@ func newTestHarnessWithConfig(cfg txmgr.Config) *testHarness { ...@@ -37,7 +37,7 @@ func newTestHarnessWithConfig(cfg txmgr.Config) *testHarness {
} }
} }
// newTestHarness initializes a testHarness with a defualt configuration that is // newTestHarness initializes a testHarness with a default configuration that is
// suitable for most tests. // suitable for most tests.
func newTestHarness() *testHarness { func newTestHarness() *testHarness {
return newTestHarnessWithConfig(configWithNumConfs(1)) return newTestHarnessWithConfig(configWithNumConfs(1))
......
...@@ -17,7 +17,7 @@ func makeTestGasPricerAndUpdater(curPrice uint64) (*GasPricer, *GasPriceUpdater, ...@@ -17,7 +17,7 @@ func makeTestGasPricerAndUpdater(curPrice uint64) (*GasPricer, *GasPriceUpdater,
getGasTarget := func() float64 { return gpsTarget } getGasTarget := func() float64 { return gpsTarget }
epochLengthSeconds := uint64(10) epochLengthSeconds := uint64(10)
averageBlockGasLimit := uint64(11000000) averageBlockGasLimit := uint64(11000000)
// Based on our 10 second epoch, we are targetting 3 blocks per epoch. // Based on our 10 second epoch, we are targeting 3 blocks per epoch.
gasPricer, err := NewGasPricer(curPrice, 1, getGasTarget, 10) gasPricer, err := NewGasPricer(curPrice, 1, getGasTarget, 10)
if err != nil { if err != nil {
return nil, nil, nil, err return nil, nil, nil, err
......
...@@ -4,6 +4,7 @@ RUN apk add --no-cache make gcc musl-dev linux-headers git jq bash ...@@ -4,6 +4,7 @@ RUN apk add --no-cache make gcc musl-dev linux-headers git jq bash
COPY ./indexer /go/indexer COPY ./indexer /go/indexer
COPY ./l2geth /go/l2geth COPY ./l2geth /go/l2geth
COPY ./op-bindings /go/op-bindings
COPY ./indexer/docker.go.work /go/go.work COPY ./indexer/docker.go.work /go/go.work
......
...@@ -7,12 +7,12 @@ LDFLAGSSTRING +=-X main.GitDate=$(GITDATE) ...@@ -7,12 +7,12 @@ LDFLAGSSTRING +=-X main.GitDate=$(GITDATE)
LDFLAGSSTRING +=-X main.GitVersion=$(GITVERSION) LDFLAGSSTRING +=-X main.GitVersion=$(GITVERSION)
LDFLAGS := -ldflags "$(LDFLAGSSTRING)" LDFLAGS := -ldflags "$(LDFLAGSSTRING)"
L1BRIDGE_ABI_ARTIFACT = ../../packages/contracts/artifacts/contracts/L1/messaging/L1StandardBridge.sol/L1StandardBridge.json L1BRIDGE_ABI_ARTIFACT = ../packages/contracts/artifacts/contracts/L1/messaging/L1StandardBridge.sol/L1StandardBridge.json
L2BRIDGE_ABI_ARTIFACT = ../../packages/contracts/artifacts/contracts/L2/messaging/L2StandardBridge.sol/L2StandardBridge.json L2BRIDGE_ABI_ARTIFACT = ../packages/contracts/artifacts/contracts/L2/messaging/L2StandardBridge.sol/L2StandardBridge.json
ERC20_ABI_ARTIFACT = ./contracts/ERC20.sol/ERC20.json ERC20_ABI_ARTIFACT = ./contracts/ERC20.sol/ERC20.json
SCC_ABI_ARTIFACT = ../../packages/contracts/artifacts/contracts/L1/rollup/StateCommitmentChain.sol/StateCommitmentChain.json SCC_ABI_ARTIFACT = ../packages/contracts/artifacts/contracts/L1/rollup/StateCommitmentChain.sol/StateCommitmentChain.json
indexer: indexer:
env GO111MODULE=on go build -v $(LDFLAGS) ./cmd/indexer env GO111MODULE=on go build -v $(LDFLAGS) ./cmd/indexer
...@@ -26,7 +26,7 @@ test: ...@@ -26,7 +26,7 @@ test:
lint: lint:
golangci-lint run ./... golangci-lint run ./...
bindings: bindings-l1bridge bindings-l2bridge bindings-l1erc20 bindings-l2erc20 bindings-scc bindings-address-manager bindings: bindings-l1bridge bindings-l2bridge bindings-l1erc20 bindings-l2erc20 bindings-scc
bindings-l1bridge: bindings-l1bridge:
$(eval temp := $(shell mktemp)) $(eval temp := $(shell mktemp))
...@@ -52,7 +52,7 @@ bindings-l2bridge: ...@@ -52,7 +52,7 @@ bindings-l2bridge:
cat $(L2BRIDGE_ABI_ARTIFACT) \ cat $(L2BRIDGE_ABI_ARTIFACT) \
| jq .abi \ | jq .abi \
| ../../l2geth/build/bin/abigen --pkg l2bridge \ | abigen --pkg l2bridge \
--abi - \ --abi - \
--out bindings/l2bridge/l2_standard_bridge.go \ --out bindings/l2bridge/l2_standard_bridge.go \
--type L2StandardBridge \ --type L2StandardBridge \
...@@ -84,7 +84,7 @@ bindings-l2erc20: ...@@ -84,7 +84,7 @@ bindings-l2erc20:
cat $(ERC20_ABI_ARTIFACT) \ cat $(ERC20_ABI_ARTIFACT) \
| jq .abi \ | jq .abi \
| ../../l2geth/build/bin/abigen --pkg l2erc20 \ | abigen --pkg l2erc20 \
--abi - \ --abi - \
--out bindings/l2erc20/l2erc20.go \ --out bindings/l2erc20/l2erc20.go \
--type L2ERC20 \ --type L2ERC20 \
...@@ -108,20 +108,6 @@ bindings-scc: ...@@ -108,20 +108,6 @@ bindings-scc:
rm $(temp) rm $(temp)
bindings-address-manager:
$(eval temp := $(shell mktemp))
cat $(ADDRESS_MANAGER_ABI_ARTIFACT) \
| jq -r .bytecode > $(temp)
cat $(ADDRESS_MANAGER_ABI_ARTIFACT) \
| jq .abi \
| abigen --pkg address_manager \
--abi - \
--out ./bindings/address_manager/address_manager.go \
--type AddressManager \
--bin $(temp)
.PHONY: \ .PHONY: \
indexer \ indexer \
bindings \ bindings \
...@@ -130,7 +116,6 @@ bindings-address-manager: ...@@ -130,7 +116,6 @@ bindings-address-manager:
bindings-l1erc20 \ bindings-l1erc20 \
bindings-l2erc20 \ bindings-l2erc20 \
bindings-scc \ bindings-scc \
bindings-address-manager
clean \ clean \
test \ test \
lint lint
...@@ -31,7 +31,7 @@ var ( ...@@ -31,7 +31,7 @@ var (
// L1StandardBridgeMetaData contains all meta data concerning the L1StandardBridge contract. // L1StandardBridgeMetaData contains all meta data concerning the L1StandardBridge contract.
var L1StandardBridgeMetaData = &bind.MetaData{ var L1StandardBridgeMetaData = &bind.MetaData{
ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_l1Token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_l2Token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"ERC20DepositInitiated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_l1Token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_l2Token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"ERC20WithdrawalFinalized\",\"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\":\"_amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"ETHDepositInitiated\",\"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\":\"_amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"ETHWithdrawalFinalized\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_l1Token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_l2Token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"_l2Gas\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"depositERC20\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_l1Token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_l2Token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"_l2Gas\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"depositERC20To\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_l2Gas\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"depositETH\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"_l2Gas\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"depositETHTo\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"deposits\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"donateETH\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_l1Token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_l2Token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"finalizeERC20Withdrawal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"finalizeETHWithdrawal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_l1messenger\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_l2TokenBridge\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l2TokenBridge\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"messenger\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_l1Token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_l2Token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"ERC20DepositInitiated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_l1Token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_l2Token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"ERC20WithdrawalFinalized\",\"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\":\"_amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"ETHDepositInitiated\",\"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\":\"_amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"ETHWithdrawalFinalized\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_l1Token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_l2Token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"_l2Gas\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"depositERC20\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_l1Token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_l2Token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"_l2Gas\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"depositERC20To\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_l2Gas\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"depositETH\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"_l2Gas\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"depositETHTo\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"deposits\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"donateETH\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_l1Token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_l2Token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"finalizeERC20Withdrawal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"finalizeETHWithdrawal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_l1messenger\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_l2TokenBridge\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l2TokenBridge\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"messenger\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]",
Bin: "0x608060405234801561001057600080fd5b50600080546001600160a01b031916905561199e806100306000396000f3fe6080604052600436106100c05760003560e01c80638b4c40b0116100745780639a2ac6d51161004e5780639a2ac6d514610288578063a9f9e6751461029b578063b1a1a882146102bb57600080fd5b80638b4c40b0146101375780638f601f661461021557806391c49bf81461025b57600080fd5b8063485cc955116100a5578063485cc955146101b557806358a997f6146101d5578063838b2520146101f557600080fd5b80631532ec341461013e5780633cb747bf1461015e57600080fd5b3661013957333b156101195760405162461bcd60e51b815260206004820152600f60248201527f4163636f756e74206e6f7420454f41000000000000000000000000000000000060448201526064015b60405180910390fd5b610137333362030d40604051806020016040528060008152506102ce565b005b600080fd5b34801561014a57600080fd5b50610137610159366004611357565b61041a565b34801561016a57600080fd5b5060005461018b9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156101c157600080fd5b506101376101d03660046113ca565b610790565b3480156101e157600080fd5b506101376101f036600461141c565b61086f565b34801561020157600080fd5b5061013761021036600461149f565b6108d6565b34801561022157600080fd5b5061024d6102303660046113ca565b600260209081526000928352604080842090915290825290205481565b6040519081526020016101ac565b34801561026757600080fd5b5060015461018b9073ffffffffffffffffffffffffffffffffffffffff1681565b610137610296366004611535565b6108ef565b3480156102a757600080fd5b506101376102b6366004611598565b610937565b6101376102c9366004611611565b610c59565b600063662a633a60e01b600073deaddeaddeaddeaddeaddeaddeaddeaddead000087873487604051602401610308969594939291906116da565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526001549091506103ac9073ffffffffffffffffffffffffffffffffffffffff168483610cef565b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f35d79ab81f2b2017e19afb5c5571778877782d7a8786f5907f93b0f4702f4f23348560405161040b929190611735565b60405180910390a35050505050565b60015473ffffffffffffffffffffffffffffffffffffffff1661045260005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104f25760405162461bcd60e51b815260206004820152602e60248201527f4f564d5f58434841494e3a206d657373656e67657220636f6e7472616374207560448201527f6e61757468656e746963617465640000000000000000000000000000000000006064820152608401610110565b8073ffffffffffffffffffffffffffffffffffffffff1661052860005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16636e296e456040518163ffffffff1660e01b815260040160206040518083038186803b15801561056d57600080fd5b505afa158015610581573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105a5919061174e565b73ffffffffffffffffffffffffffffffffffffffff161461062e5760405162461bcd60e51b815260206004820152603060248201527f4f564d5f58434841494e3a2077726f6e672073656e646572206f662063726f7360448201527f732d646f6d61696e206d657373616765000000000000000000000000000000006064820152608401610110565b6040805160008082526020820190925273ffffffffffffffffffffffffffffffffffffffff8716908690604051610665919061176b565b60006040518083038185875af1925050503d80600081146106a2576040519150601f19603f3d011682016040523d82523d6000602084013e6106a7565b606091505b505090508061071e5760405162461bcd60e51b815260206004820152603460248201527f5472616e7366657248656c7065723a3a736166655472616e736665724554483a60448201527f20455448207472616e73666572206661696c65640000000000000000000000006064820152608401610110565b8573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167f2ac69ee804d9a7a0984249f508dfab7cb2534b465b6ce1580f99a38ba9c5e63187878760405161077f939291906117d0565b60405180910390a350505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff161561081c5760405162461bcd60e51b815260206004820152602660248201527f436f6e74726163742068617320616c7265616479206265656e20696e6974696160448201527f6c697a65642e00000000000000000000000000000000000000000000000000006064820152608401610110565b6000805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560018054929093169116179055565b333b156108be5760405162461bcd60e51b815260206004820152600f60248201527f4163636f756e74206e6f7420454f4100000000000000000000000000000000006044820152606401610110565b6108ce8686333388888888610d77565b505050505050565b6108e68787338888888888610d77565b50505050505050565b61093133858585858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506102ce92505050565b50505050565b60015473ffffffffffffffffffffffffffffffffffffffff1661096f60005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a0f5760405162461bcd60e51b815260206004820152602e60248201527f4f564d5f58434841494e3a206d657373656e67657220636f6e7472616374207560448201527f6e61757468656e746963617465640000000000000000000000000000000000006064820152608401610110565b8073ffffffffffffffffffffffffffffffffffffffff16610a4560005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16636e296e456040518163ffffffff1660e01b815260040160206040518083038186803b158015610a8a57600080fd5b505afa158015610a9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac2919061174e565b73ffffffffffffffffffffffffffffffffffffffff1614610b4b5760405162461bcd60e51b815260206004820152603060248201527f4f564d5f58434841494e3a2077726f6e672073656e646572206f662063726f7360448201527f732d646f6d61696e206d657373616765000000000000000000000000000000006064820152608401610110565b73ffffffffffffffffffffffffffffffffffffffff8089166000908152600260209081526040808320938b1683529290522054610b89908590611822565b73ffffffffffffffffffffffffffffffffffffffff808a166000818152600260209081526040808320948d1683529390529190912091909155610bcd908686610f27565b8573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167f3ceee06c1e37648fcbb6ed52e17b3e1f275a1f8c7b22a84b2b84732431e046b388888888604051610c479493929190611839565b60405180910390a45050505050505050565b333b15610ca85760405162461bcd60e51b815260206004820152600f60248201527f4163636f756e74206e6f7420454f4100000000000000000000000000000000006044820152606401610110565b610cea33338585858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506102ce92505050565b505050565b6000546040517f3dbb202b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911690633dbb202b90610d4990869085908790600401611879565b600060405180830381600087803b158015610d6357600080fd5b505af11580156108e6573d6000803e3d6000fd5b610d9973ffffffffffffffffffffffffffffffffffffffff8916873087610ffb565b600063662a633a60e01b89898989898888604051602401610dc097969594939291906118be565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152600154909150610e649073ffffffffffffffffffffffffffffffffffffffff168583610cef565b73ffffffffffffffffffffffffffffffffffffffff808a166000908152600260209081526040808320938c1683529290522054610ea290869061191b565b73ffffffffffffffffffffffffffffffffffffffff808b1660008181526002602090815260408083208e86168085529252918290209490945551918a1692917f718594027abd4eaed59f95162563e0cc6d0e8d5b86b1c7be8b1b0ac3343d039690610f14908b908b908a908a90611839565b60405180910390a4505050505050505050565b60405173ffffffffffffffffffffffffffffffffffffffff8316602482015260448101829052610cea9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611059565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526109319085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401610f79565b60006110bb826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661114b9092919063ffffffff16565b805190915015610cea57808060200190518101906110d99190611933565b610cea5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610110565b606061115a8484600085611164565b90505b9392505050565b6060824710156111dc5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610110565b843b61122a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610110565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051611253919061176b565b60006040518083038185875af1925050503d8060008114611290576040519150601f19603f3d011682016040523d82523d6000602084013e611295565b606091505b50915091506112a58282866112b0565b979650505050505050565b606083156112bf57508161115d565b8251156112cf5782518084602001fd5b8160405162461bcd60e51b81526004016101109190611955565b73ffffffffffffffffffffffffffffffffffffffff8116811461130b57600080fd5b50565b60008083601f84011261132057600080fd5b50813567ffffffffffffffff81111561133857600080fd5b60208301915083602082850101111561135057600080fd5b9250929050565b60008060008060006080868803121561136f57600080fd5b853561137a816112e9565b9450602086013561138a816112e9565b935060408601359250606086013567ffffffffffffffff8111156113ad57600080fd5b6113b98882890161130e565b969995985093965092949392505050565b600080604083850312156113dd57600080fd5b82356113e8816112e9565b915060208301356113f8816112e9565b809150509250929050565b803563ffffffff8116811461141757600080fd5b919050565b60008060008060008060a0878903121561143557600080fd5b8635611440816112e9565b95506020870135611450816112e9565b94506040870135935061146560608801611403565b9250608087013567ffffffffffffffff81111561148157600080fd5b61148d89828a0161130e565b979a9699509497509295939492505050565b600080600080600080600060c0888a0312156114ba57600080fd5b87356114c5816112e9565b965060208801356114d5816112e9565b955060408801356114e5816112e9565b9450606088013593506114fa60808901611403565b925060a088013567ffffffffffffffff81111561151657600080fd5b6115228a828b0161130e565b989b979a50959850939692959293505050565b6000806000806060858703121561154b57600080fd5b8435611556816112e9565b935061156460208601611403565b9250604085013567ffffffffffffffff81111561158057600080fd5b61158c8782880161130e565b95989497509550505050565b600080600080600080600060c0888a0312156115b357600080fd5b87356115be816112e9565b965060208801356115ce816112e9565b955060408801356115de816112e9565b945060608801356115ee816112e9565b93506080880135925060a088013567ffffffffffffffff81111561151657600080fd5b60008060006040848603121561162657600080fd5b61162f84611403565b9250602084013567ffffffffffffffff81111561164b57600080fd5b6116578682870161130e565b9497909650939450505050565b60005b8381101561167f578181015183820152602001611667565b838111156109315750506000910152565b600081518084526116a8816020860160208601611664565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600073ffffffffffffffffffffffffffffffffffffffff80891683528088166020840152808716604084015280861660608401525083608083015260c060a083015261172960c0830184611690565b98975050505050505050565b82815260406020820152600061115a6040830184611690565b60006020828403121561176057600080fd5b815161115d816112e9565b6000825161177d818460208701611664565b9190910192915050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b8381526040602082015260006117ea604083018486611787565b95945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082821015611834576118346117f3565b500390565b73ffffffffffffffffffffffffffffffffffffffff8516815283602082015260606040820152600061186f606083018486611787565b9695505050505050565b73ffffffffffffffffffffffffffffffffffffffff841681526060602082015260006118a86060830185611690565b905063ffffffff83166040830152949350505050565b600073ffffffffffffffffffffffffffffffffffffffff808a1683528089166020840152808816604084015280871660608401525084608083015260c060a083015261190e60c083018486611787565b9998505050505050505050565b6000821982111561192e5761192e6117f3565b500190565b60006020828403121561194557600080fd5b8151801515811461115d57600080fd5b60208152600061115d602083018461169056fea2646970667358221220ab0015e7cee64db6dc95e6eb0899ae4017c78ab54ebce874e3b018a7bc88850364736f6c63430008090033", Bin: "0x608060405234801561001057600080fd5b50600080546001600160a01b031916905561199e806100306000396000f3fe6080604052600436106100c05760003560e01c80638b4c40b0116100745780639a2ac6d51161004e5780639a2ac6d514610288578063a9f9e6751461029b578063b1a1a882146102bb57600080fd5b80638b4c40b0146101375780638f601f661461021557806391c49bf81461025b57600080fd5b8063485cc955116100a5578063485cc955146101b557806358a997f6146101d5578063838b2520146101f557600080fd5b80631532ec341461013e5780633cb747bf1461015e57600080fd5b3661013957333b156101195760405162461bcd60e51b815260206004820152600f60248201527f4163636f756e74206e6f7420454f41000000000000000000000000000000000060448201526064015b60405180910390fd5b610137333362030d40604051806020016040528060008152506102ce565b005b600080fd5b34801561014a57600080fd5b50610137610159366004611357565b61041a565b34801561016a57600080fd5b5060005461018b9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156101c157600080fd5b506101376101d03660046113ca565b610790565b3480156101e157600080fd5b506101376101f036600461141c565b61086f565b34801561020157600080fd5b5061013761021036600461149f565b6108d6565b34801561022157600080fd5b5061024d6102303660046113ca565b600260209081526000928352604080842090915290825290205481565b6040519081526020016101ac565b34801561026757600080fd5b5060015461018b9073ffffffffffffffffffffffffffffffffffffffff1681565b610137610296366004611535565b6108ef565b3480156102a757600080fd5b506101376102b6366004611598565b610937565b6101376102c9366004611611565b610c59565b600063662a633a60e01b600073deaddeaddeaddeaddeaddeaddeaddeaddead000087873487604051602401610308969594939291906116da565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526001549091506103ac9073ffffffffffffffffffffffffffffffffffffffff168483610cef565b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f35d79ab81f2b2017e19afb5c5571778877782d7a8786f5907f93b0f4702f4f23348560405161040b929190611735565b60405180910390a35050505050565b60015473ffffffffffffffffffffffffffffffffffffffff1661045260005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104f25760405162461bcd60e51b815260206004820152602e60248201527f4f564d5f58434841494e3a206d657373656e67657220636f6e7472616374207560448201527f6e61757468656e746963617465640000000000000000000000000000000000006064820152608401610110565b8073ffffffffffffffffffffffffffffffffffffffff1661052860005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16636e296e456040518163ffffffff1660e01b815260040160206040518083038186803b15801561056d57600080fd5b505afa158015610581573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105a5919061174e565b73ffffffffffffffffffffffffffffffffffffffff161461062e5760405162461bcd60e51b815260206004820152603060248201527f4f564d5f58434841494e3a2077726f6e672073656e646572206f662063726f7360448201527f732d646f6d61696e206d657373616765000000000000000000000000000000006064820152608401610110565b6040805160008082526020820190925273ffffffffffffffffffffffffffffffffffffffff8716908690604051610665919061176b565b60006040518083038185875af1925050503d80600081146106a2576040519150601f19603f3d011682016040523d82523d6000602084013e6106a7565b606091505b505090508061071e5760405162461bcd60e51b815260206004820152603460248201527f5472616e7366657248656c7065723a3a736166655472616e736665724554483a60448201527f20455448207472616e73666572206661696c65640000000000000000000000006064820152608401610110565b8573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167f2ac69ee804d9a7a0984249f508dfab7cb2534b465b6ce1580f99a38ba9c5e63187878760405161077f939291906117d0565b60405180910390a350505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff161561081c5760405162461bcd60e51b815260206004820152602660248201527f436f6e74726163742068617320616c7265616479206265656e20696e6974696160448201527f6c697a65642e00000000000000000000000000000000000000000000000000006064820152608401610110565b6000805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560018054929093169116179055565b333b156108be5760405162461bcd60e51b815260206004820152600f60248201527f4163636f756e74206e6f7420454f4100000000000000000000000000000000006044820152606401610110565b6108ce8686333388888888610d77565b505050505050565b6108e68787338888888888610d77565b50505050505050565b61093133858585858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506102ce92505050565b50505050565b60015473ffffffffffffffffffffffffffffffffffffffff1661096f60005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a0f5760405162461bcd60e51b815260206004820152602e60248201527f4f564d5f58434841494e3a206d657373656e67657220636f6e7472616374207560448201527f6e61757468656e746963617465640000000000000000000000000000000000006064820152608401610110565b8073ffffffffffffffffffffffffffffffffffffffff16610a4560005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16636e296e456040518163ffffffff1660e01b815260040160206040518083038186803b158015610a8a57600080fd5b505afa158015610a9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac2919061174e565b73ffffffffffffffffffffffffffffffffffffffff1614610b4b5760405162461bcd60e51b815260206004820152603060248201527f4f564d5f58434841494e3a2077726f6e672073656e646572206f662063726f7360448201527f732d646f6d61696e206d657373616765000000000000000000000000000000006064820152608401610110565b73ffffffffffffffffffffffffffffffffffffffff8089166000908152600260209081526040808320938b1683529290522054610b89908590611822565b73ffffffffffffffffffffffffffffffffffffffff808a166000818152600260209081526040808320948d1683529390529190912091909155610bcd908686610f27565b8573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167f3ceee06c1e37648fcbb6ed52e17b3e1f275a1f8c7b22a84b2b84732431e046b388888888604051610c479493929190611839565b60405180910390a45050505050505050565b333b15610ca85760405162461bcd60e51b815260206004820152600f60248201527f4163636f756e74206e6f7420454f4100000000000000000000000000000000006044820152606401610110565b610cea33338585858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506102ce92505050565b505050565b6000546040517f3dbb202b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911690633dbb202b90610d4990869085908790600401611879565b600060405180830381600087803b158015610d6357600080fd5b505af11580156108e6573d6000803e3d6000fd5b610d9973ffffffffffffffffffffffffffffffffffffffff8916873087610ffb565b600063662a633a60e01b89898989898888604051602401610dc097969594939291906118be565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152600154909150610e649073ffffffffffffffffffffffffffffffffffffffff168583610cef565b73ffffffffffffffffffffffffffffffffffffffff808a166000908152600260209081526040808320938c1683529290522054610ea290869061191b565b73ffffffffffffffffffffffffffffffffffffffff808b1660008181526002602090815260408083208e86168085529252918290209490945551918a1692917f718594027abd4eaed59f95162563e0cc6d0e8d5b86b1c7be8b1b0ac3343d039690610f14908b908b908a908a90611839565b60405180910390a4505050505050505050565b60405173ffffffffffffffffffffffffffffffffffffffff8316602482015260448101829052610cea9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611059565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526109319085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401610f79565b60006110bb826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661114b9092919063ffffffff16565b805190915015610cea57808060200190518101906110d99190611933565b610cea5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610110565b606061115a8484600085611164565b90505b9392505050565b6060824710156111dc5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610110565b843b61122a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610110565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051611253919061176b565b60006040518083038185875af1925050503d8060008114611290576040519150601f19603f3d011682016040523d82523d6000602084013e611295565b606091505b50915091506112a58282866112b0565b979650505050505050565b606083156112bf57508161115d565b8251156112cf5782518084602001fd5b8160405162461bcd60e51b81526004016101109190611955565b73ffffffffffffffffffffffffffffffffffffffff8116811461130b57600080fd5b50565b60008083601f84011261132057600080fd5b50813567ffffffffffffffff81111561133857600080fd5b60208301915083602082850101111561135057600080fd5b9250929050565b60008060008060006080868803121561136f57600080fd5b853561137a816112e9565b9450602086013561138a816112e9565b935060408601359250606086013567ffffffffffffffff8111156113ad57600080fd5b6113b98882890161130e565b969995985093965092949392505050565b600080604083850312156113dd57600080fd5b82356113e8816112e9565b915060208301356113f8816112e9565b809150509250929050565b803563ffffffff8116811461141757600080fd5b919050565b60008060008060008060a0878903121561143557600080fd5b8635611440816112e9565b95506020870135611450816112e9565b94506040870135935061146560608801611403565b9250608087013567ffffffffffffffff81111561148157600080fd5b61148d89828a0161130e565b979a9699509497509295939492505050565b600080600080600080600060c0888a0312156114ba57600080fd5b87356114c5816112e9565b965060208801356114d5816112e9565b955060408801356114e5816112e9565b9450606088013593506114fa60808901611403565b925060a088013567ffffffffffffffff81111561151657600080fd5b6115228a828b0161130e565b989b979a50959850939692959293505050565b6000806000806060858703121561154b57600080fd5b8435611556816112e9565b935061156460208601611403565b9250604085013567ffffffffffffffff81111561158057600080fd5b61158c8782880161130e565b95989497509550505050565b600080600080600080600060c0888a0312156115b357600080fd5b87356115be816112e9565b965060208801356115ce816112e9565b955060408801356115de816112e9565b945060608801356115ee816112e9565b93506080880135925060a088013567ffffffffffffffff81111561151657600080fd5b60008060006040848603121561162657600080fd5b61162f84611403565b9250602084013567ffffffffffffffff81111561164b57600080fd5b6116578682870161130e565b9497909650939450505050565b60005b8381101561167f578181015183820152602001611667565b838111156109315750506000910152565b600081518084526116a8816020860160208601611664565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600073ffffffffffffffffffffffffffffffffffffffff80891683528088166020840152808716604084015280861660608401525083608083015260c060a083015261172960c0830184611690565b98975050505050505050565b82815260406020820152600061115a6040830184611690565b60006020828403121561176057600080fd5b815161115d816112e9565b6000825161177d818460208701611664565b9190910192915050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b8381526040602082015260006117ea604083018486611787565b95945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082821015611834576118346117f3565b500390565b73ffffffffffffffffffffffffffffffffffffffff8516815283602082015260606040820152600061186f606083018486611787565b9695505050505050565b73ffffffffffffffffffffffffffffffffffffffff841681526060602082015260006118a86060830185611690565b905063ffffffff83166040830152949350505050565b600073ffffffffffffffffffffffffffffffffffffffff808a1683528089166020840152808816604084015280871660608401525084608083015260c060a083015261190e60c083018486611787565b9998505050505050505050565b6000821982111561192e5761192e6117f3565b500190565b60006020828403121561194557600080fd5b8151801515811461115d57600080fd5b60208152600061115d602083018461169056fea2646970667358221220dfeb5a290dc91255dcaeb90a957ac2d5b021296fa076dc234a69e330481b4dd064736f6c63430008090033",
} }
// L1StandardBridgeABI is the input ABI used to generate the binding from. // L1StandardBridgeABI is the input ABI used to generate the binding from.
......
...@@ -4,43 +4,55 @@ ...@@ -4,43 +4,55 @@
package l2bridge package l2bridge
import ( import (
"errors"
"math/big" "math/big"
"strings" "strings"
ethereum "github.com/ethereum-optimism/optimism/l2geth" ethereum "github.com/ethereum/go-ethereum"
"github.com/ethereum-optimism/optimism/l2geth/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum-optimism/optimism/l2geth/accounts/abi/bind" "github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum-optimism/optimism/l2geth/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum-optimism/optimism/l2geth/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum-optimism/optimism/l2geth/event" "github.com/ethereum/go-ethereum/event"
) )
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
var ( var (
_ = errors.New
_ = big.NewInt _ = big.NewInt
_ = strings.NewReader _ = strings.NewReader
_ = ethereum.NotFound _ = ethereum.NotFound
_ = abi.U256
_ = bind.Bind _ = bind.Bind
_ = common.Big1 _ = common.Big1
_ = types.BloomLookup _ = types.BloomLookup
_ = event.NewSubscription _ = event.NewSubscription
) )
// L2StandardBridgeMetaData contains all meta data concerning the L2StandardBridge contract.
var L2StandardBridgeMetaData = &bind.MetaData{
ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_l2CrossDomainMessenger\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_l1TokenBridge\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_l1Token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_l2Token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"DepositFailed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_l1Token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_l2Token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"DepositFinalized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_l1Token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_l2Token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"WithdrawalInitiated\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_l1Token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_l2Token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"finalizeDeposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l1TokenBridge\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"messenger\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_l2Token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"_l1Gas\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_l2Token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"_l1Gas\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"withdrawTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]",
Bin: "0x608060405234801561001057600080fd5b506040516111c43803806111c483398101604081905261002f9161007c565b600080546001600160a01b039384166001600160a01b031991821617909155600180549290931691161790556100af565b80516001600160a01b038116811461007757600080fd5b919050565b6000806040838503121561008f57600080fd5b61009883610060565b91506100a660208401610060565b90509250929050565b611106806100be6000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c80633cb747bf116100505780633cb747bf146100ca578063662a633a146100ea578063a3a79548146100fd57600080fd5b806332b7006d1461006c57806336c717c114610081575b600080fd5b61007f61007a366004610d0f565b610110565b005b6001546100a19073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6000546100a19073ffffffffffffffffffffffffffffffffffffffff1681565b61007f6100f8366004610d80565b610126565b61007f61010b366004610e18565b6106c1565b61011f853333878787876106d8565b5050505050565b60015473ffffffffffffffffffffffffffffffffffffffff1661015e60005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461021d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f4f564d5f58434841494e3a206d657373656e67657220636f6e7472616374207560448201527f6e61757468656e7469636174656400000000000000000000000000000000000060648201526084015b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1661025360005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16636e296e456040518163ffffffff1660e01b815260040160206040518083038186803b15801561029857600080fd5b505afa1580156102ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102d09190610e9b565b73ffffffffffffffffffffffffffffffffffffffff1614610373576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f4f564d5f58434841494e3a2077726f6e672073656e646572206f662063726f7360448201527f732d646f6d61696e206d657373616765000000000000000000000000000000006064820152608401610214565b61039d877f1d1d8b6300000000000000000000000000000000000000000000000000000000610a32565b801561045357508673ffffffffffffffffffffffffffffffffffffffff1663c01e1bd66040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156103ec57600080fd5b505af1158015610400573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104249190610e9b565b73ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff16145b15610567576040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8681166004830152602482018690528816906340c10f1990604401600060405180830381600087803b1580156104c857600080fd5b505af11580156104dc573d6000803e3d6000fd5b505050508573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fb0444523268717a02698be47d0803aa7468c00acbed2f8bd93a0459cde61dd898888888860405161055a9493929190610f08565b60405180910390a46106b7565b600063a9f9e67560e01b8989888a89898960405160240161058e9796959493929190610f3e565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526001549091506106339073ffffffffffffffffffffffffffffffffffffffff16600083610a57565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff167f7ea89a4591614515571c2b51f5ea06494056f261c10ab1ed8c03c7590d87bce0898989896040516106ad9493929190610f08565b60405180910390a4505b5050505050505050565b6106d0863387878787876106d8565b505050505050565b6040517f9dc29fac0000000000000000000000000000000000000000000000000000000081523360048201526024810185905273ffffffffffffffffffffffffffffffffffffffff881690639dc29fac90604401600060405180830381600087803b15801561074657600080fd5b505af115801561075a573d6000803e3d6000fd5b5050505060008773ffffffffffffffffffffffffffffffffffffffff1663c01e1bd66040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156107a857600080fd5b505af11580156107bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e09190610e9b565b9050606073ffffffffffffffffffffffffffffffffffffffff891673deaddeaddeaddeaddeaddeaddeaddeaddead000014156108d5576040517f1532ec340000000000000000000000000000000000000000000000000000000090610851908a908a908a9089908990602401610f9b565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091529050610994565b6040517fa9f9e67500000000000000000000000000000000000000000000000000000000906109149084908c908c908c908c908b908b90602401610f3e565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915290505b6001546109b89073ffffffffffffffffffffffffffffffffffffffff168683610a57565b3373ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f73d170910aba9e6d50b102db522b1dbcd796216f5128b445aa2135272886497e8a8a89896040516106ad9493929190610f08565b6000610a3d83610ae8565b8015610a4e5750610a4e8383610b4c565b90505b92915050565b6000546040517f3dbb202b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911690633dbb202b90610ab190869085908790600401611016565b600060405180830381600087803b158015610acb57600080fd5b505af1158015610adf573d6000803e3d6000fd5b50505050505050565b6000610b14827f01ffc9a700000000000000000000000000000000000000000000000000000000610b4c565b8015610a515750610b45827fffffffff00000000000000000000000000000000000000000000000000000000610b4c565b1592915050565b604080517fffffffff00000000000000000000000000000000000000000000000000000000831660248083019190915282518083039091018152604490910182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f01ffc9a7000000000000000000000000000000000000000000000000000000001790529051600091908290819073ffffffffffffffffffffffffffffffffffffffff87169061753090610c06908690611092565b6000604051808303818686fa925050503d8060008114610c42576040519150601f19603f3d011682016040523d82523d6000602084013e610c47565b606091505b5091509150602081511015610c625760009350505050610a51565b818015610c7e575080806020019051810190610c7e91906110ae565b9695505050505050565b73ffffffffffffffffffffffffffffffffffffffff81168114610caa57600080fd5b50565b803563ffffffff81168114610cc157600080fd5b919050565b60008083601f840112610cd857600080fd5b50813567ffffffffffffffff811115610cf057600080fd5b602083019150836020828501011115610d0857600080fd5b9250929050565b600080600080600060808688031215610d2757600080fd5b8535610d3281610c88565b945060208601359350610d4760408701610cad565b9250606086013567ffffffffffffffff811115610d6357600080fd5b610d6f88828901610cc6565b969995985093965092949392505050565b600080600080600080600060c0888a031215610d9b57600080fd5b8735610da681610c88565b96506020880135610db681610c88565b95506040880135610dc681610c88565b94506060880135610dd681610c88565b93506080880135925060a088013567ffffffffffffffff811115610df957600080fd5b610e058a828b01610cc6565b989b979a50959850939692959293505050565b60008060008060008060a08789031215610e3157600080fd5b8635610e3c81610c88565b95506020870135610e4c81610c88565b945060408701359350610e6160608801610cad565b9250608087013567ffffffffffffffff811115610e7d57600080fd5b610e8989828a01610cc6565b979a9699509497509295939492505050565b600060208284031215610ead57600080fd5b8151610eb881610c88565b9392505050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b73ffffffffffffffffffffffffffffffffffffffff85168152836020820152606060408201526000610c7e606083018486610ebf565b600073ffffffffffffffffffffffffffffffffffffffff808a1683528089166020840152808816604084015280871660608401525084608083015260c060a0830152610f8e60c083018486610ebf565b9998505050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff808816835280871660208401525084604083015260806060830152610fdb608083018486610ebf565b979650505050505050565b60005b83811015611001578181015183820152602001610fe9565b83811115611010576000848401525b50505050565b73ffffffffffffffffffffffffffffffffffffffff841681526060602082015260008351806060840152611051816080850160208801610fe6565b63ffffffff93909316604083015250601f919091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160160800192915050565b600082516110a4818460208701610fe6565b9190910192915050565b6000602082840312156110c057600080fd5b81518015158114610eb857600080fdfea2646970667358221220df892c82e9ba0fc965240aa38614ff1bd6af4d227ce2c0e9933d7f50711a886264736f6c63430008090033",
}
// L2StandardBridgeABI is the input ABI used to generate the binding from. // L2StandardBridgeABI is the input ABI used to generate the binding from.
const L2StandardBridgeABI = "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_l2CrossDomainMessenger\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_l1TokenBridge\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_l1Token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_l2Token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"DepositFailed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_l1Token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_l2Token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"DepositFinalized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_l1Token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_l2Token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"WithdrawalInitiated\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_l1Token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_l2Token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"finalizeDeposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l1TokenBridge\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"messenger\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_l2Token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"_l1Gas\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_l2Token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"_l1Gas\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"withdrawTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" // Deprecated: Use L2StandardBridgeMetaData.ABI instead.
var L2StandardBridgeABI = L2StandardBridgeMetaData.ABI
// L2StandardBridgeBin is the compiled bytecode used for deploying new contracts. // L2StandardBridgeBin is the compiled bytecode used for deploying new contracts.
var L2StandardBridgeBin = "0x608060405234801561001057600080fd5b506040516111c43803806111c483398101604081905261002f9161007c565b600080546001600160a01b039384166001600160a01b031991821617909155600180549290931691161790556100af565b80516001600160a01b038116811461007757600080fd5b919050565b6000806040838503121561008f57600080fd5b61009883610060565b91506100a660208401610060565b90509250929050565b611106806100be6000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c80633cb747bf116100505780633cb747bf146100ca578063662a633a146100ea578063a3a79548146100fd57600080fd5b806332b7006d1461006c57806336c717c114610081575b600080fd5b61007f61007a366004610d0f565b610110565b005b6001546100a19073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6000546100a19073ffffffffffffffffffffffffffffffffffffffff1681565b61007f6100f8366004610d80565b610126565b61007f61010b366004610e18565b6106c1565b61011f853333878787876106d8565b5050505050565b60015473ffffffffffffffffffffffffffffffffffffffff1661015e60005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461021d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f4f564d5f58434841494e3a206d657373656e67657220636f6e7472616374207560448201527f6e61757468656e7469636174656400000000000000000000000000000000000060648201526084015b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1661025360005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16636e296e456040518163ffffffff1660e01b815260040160206040518083038186803b15801561029857600080fd5b505afa1580156102ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102d09190610e9b565b73ffffffffffffffffffffffffffffffffffffffff1614610373576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f4f564d5f58434841494e3a2077726f6e672073656e646572206f662063726f7360448201527f732d646f6d61696e206d657373616765000000000000000000000000000000006064820152608401610214565b61039d877f1d1d8b6300000000000000000000000000000000000000000000000000000000610a32565b801561045357508673ffffffffffffffffffffffffffffffffffffffff1663c01e1bd66040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156103ec57600080fd5b505af1158015610400573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104249190610e9b565b73ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff16145b15610567576040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8681166004830152602482018690528816906340c10f1990604401600060405180830381600087803b1580156104c857600080fd5b505af11580156104dc573d6000803e3d6000fd5b505050508573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fb0444523268717a02698be47d0803aa7468c00acbed2f8bd93a0459cde61dd898888888860405161055a9493929190610f08565b60405180910390a46106b7565b600063a9f9e67560e01b8989888a89898960405160240161058e9796959493929190610f3e565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526001549091506106339073ffffffffffffffffffffffffffffffffffffffff16600083610a57565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff167f7ea89a4591614515571c2b51f5ea06494056f261c10ab1ed8c03c7590d87bce0898989896040516106ad9493929190610f08565b60405180910390a4505b5050505050505050565b6106d0863387878787876106d8565b505050505050565b6040517f9dc29fac0000000000000000000000000000000000000000000000000000000081523360048201526024810185905273ffffffffffffffffffffffffffffffffffffffff881690639dc29fac90604401600060405180830381600087803b15801561074657600080fd5b505af115801561075a573d6000803e3d6000fd5b5050505060008773ffffffffffffffffffffffffffffffffffffffff1663c01e1bd66040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156107a857600080fd5b505af11580156107bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e09190610e9b565b9050606073ffffffffffffffffffffffffffffffffffffffff891673deaddeaddeaddeaddeaddeaddeaddeaddead000014156108d5576040517f1532ec340000000000000000000000000000000000000000000000000000000090610851908a908a908a9089908990602401610f9b565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091529050610994565b6040517fa9f9e67500000000000000000000000000000000000000000000000000000000906109149084908c908c908c908c908b908b90602401610f3e565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915290505b6001546109b89073ffffffffffffffffffffffffffffffffffffffff168683610a57565b3373ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f73d170910aba9e6d50b102db522b1dbcd796216f5128b445aa2135272886497e8a8a89896040516106ad9493929190610f08565b6000610a3d83610ae8565b8015610a4e5750610a4e8383610b4c565b90505b92915050565b6000546040517f3dbb202b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911690633dbb202b90610ab190869085908790600401611016565b600060405180830381600087803b158015610acb57600080fd5b505af1158015610adf573d6000803e3d6000fd5b50505050505050565b6000610b14827f01ffc9a700000000000000000000000000000000000000000000000000000000610b4c565b8015610a515750610b45827fffffffff00000000000000000000000000000000000000000000000000000000610b4c565b1592915050565b604080517fffffffff00000000000000000000000000000000000000000000000000000000831660248083019190915282518083039091018152604490910182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f01ffc9a7000000000000000000000000000000000000000000000000000000001790529051600091908290819073ffffffffffffffffffffffffffffffffffffffff87169061753090610c06908690611092565b6000604051808303818686fa925050503d8060008114610c42576040519150601f19603f3d011682016040523d82523d6000602084013e610c47565b606091505b5091509150602081511015610c625760009350505050610a51565b818015610c7e575080806020019051810190610c7e91906110ae565b9695505050505050565b73ffffffffffffffffffffffffffffffffffffffff81168114610caa57600080fd5b50565b803563ffffffff81168114610cc157600080fd5b919050565b60008083601f840112610cd857600080fd5b50813567ffffffffffffffff811115610cf057600080fd5b602083019150836020828501011115610d0857600080fd5b9250929050565b600080600080600060808688031215610d2757600080fd5b8535610d3281610c88565b945060208601359350610d4760408701610cad565b9250606086013567ffffffffffffffff811115610d6357600080fd5b610d6f88828901610cc6565b969995985093965092949392505050565b600080600080600080600060c0888a031215610d9b57600080fd5b8735610da681610c88565b96506020880135610db681610c88565b95506040880135610dc681610c88565b94506060880135610dd681610c88565b93506080880135925060a088013567ffffffffffffffff811115610df957600080fd5b610e058a828b01610cc6565b989b979a50959850939692959293505050565b60008060008060008060a08789031215610e3157600080fd5b8635610e3c81610c88565b95506020870135610e4c81610c88565b945060408701359350610e6160608801610cad565b9250608087013567ffffffffffffffff811115610e7d57600080fd5b610e8989828a01610cc6565b979a9699509497509295939492505050565b600060208284031215610ead57600080fd5b8151610eb881610c88565b9392505050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b73ffffffffffffffffffffffffffffffffffffffff85168152836020820152606060408201526000610c7e606083018486610ebf565b600073ffffffffffffffffffffffffffffffffffffffff808a1683528089166020840152808816604084015280871660608401525084608083015260c060a0830152610f8e60c083018486610ebf565b9998505050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff808816835280871660208401525084604083015260806060830152610fdb608083018486610ebf565b979650505050505050565b60005b83811015611001578181015183820152602001610fe9565b83811115611010576000848401525b50505050565b73ffffffffffffffffffffffffffffffffffffffff841681526060602082015260008351806060840152611051816080850160208801610fe6565b63ffffffff93909316604083015250601f919091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160160800192915050565b600082516110a4818460208701610fe6565b9190910192915050565b6000602082840312156110c057600080fd5b81518015158114610eb857600080fdfea264697066735822122003f4a9fcb2a89d7ca3b6ba7d919977ee33454f3b42553a547cba18d3eb2313c064736f6c63430008090033" // Deprecated: Use L2StandardBridgeMetaData.Bin instead.
var L2StandardBridgeBin = L2StandardBridgeMetaData.Bin
// DeployL2StandardBridge deploys a new Ethereum contract, binding an instance of L2StandardBridge to it. // DeployL2StandardBridge deploys a new Ethereum contract, binding an instance of L2StandardBridge to it.
func DeployL2StandardBridge(auth *bind.TransactOpts, backend bind.ContractBackend, _l2CrossDomainMessenger common.Address, _l1TokenBridge common.Address) (common.Address, *types.Transaction, *L2StandardBridge, error) { func DeployL2StandardBridge(auth *bind.TransactOpts, backend bind.ContractBackend, _l2CrossDomainMessenger common.Address, _l1TokenBridge common.Address) (common.Address, *types.Transaction, *L2StandardBridge, error) {
parsed, err := abi.JSON(strings.NewReader(L2StandardBridgeABI)) parsed, err := L2StandardBridgeMetaData.GetAbi()
if err != nil { if err != nil {
return common.Address{}, nil, nil, err 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, _l2CrossDomainMessenger, _l1TokenBridge) address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(L2StandardBridgeBin), backend, _l2CrossDomainMessenger, _l1TokenBridge)
if err != nil { if err != nil {
return common.Address{}, nil, nil, err return common.Address{}, nil, nil, err
} }
...@@ -155,7 +167,7 @@ func bindL2StandardBridge(address common.Address, caller bind.ContractCaller, tr ...@@ -155,7 +167,7 @@ func bindL2StandardBridge(address common.Address, caller bind.ContractCaller, tr
// sets the output to result. The result type might be a single field for simple // 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, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_L2StandardBridge *L2StandardBridgeRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_L2StandardBridge *L2StandardBridgeRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _L2StandardBridge.Contract.L2StandardBridgeCaller.contract.Call(opts, result, method, params...) return _L2StandardBridge.Contract.L2StandardBridgeCaller.contract.Call(opts, result, method, params...)
} }
...@@ -174,7 +186,7 @@ func (_L2StandardBridge *L2StandardBridgeRaw) Transact(opts *bind.TransactOpts, ...@@ -174,7 +186,7 @@ func (_L2StandardBridge *L2StandardBridgeRaw) Transact(opts *bind.TransactOpts,
// sets the output to result. The result type might be a single field for simple // 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, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_L2StandardBridge *L2StandardBridgeCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_L2StandardBridge *L2StandardBridgeCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _L2StandardBridge.Contract.contract.Call(opts, result, method, params...) return _L2StandardBridge.Contract.contract.Call(opts, result, method, params...)
} }
...@@ -191,52 +203,62 @@ func (_L2StandardBridge *L2StandardBridgeTransactorRaw) Transact(opts *bind.Tran ...@@ -191,52 +203,62 @@ func (_L2StandardBridge *L2StandardBridgeTransactorRaw) Transact(opts *bind.Tran
// L1TokenBridge is a free data retrieval call binding the contract method 0x36c717c1. // L1TokenBridge is a free data retrieval call binding the contract method 0x36c717c1.
// //
// Solidity: function l1TokenBridge() constant returns(address) // Solidity: function l1TokenBridge() view returns(address)
func (_L2StandardBridge *L2StandardBridgeCaller) L1TokenBridge(opts *bind.CallOpts) (common.Address, error) { func (_L2StandardBridge *L2StandardBridgeCaller) L1TokenBridge(opts *bind.CallOpts) (common.Address, error) {
var ( var out []interface{}
ret0 = new(common.Address) err := _L2StandardBridge.contract.Call(opts, &out, "l1TokenBridge")
)
out := ret0 if err != nil {
err := _L2StandardBridge.contract.Call(opts, out, "l1TokenBridge") return *new(common.Address), err
return *ret0, 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. // L1TokenBridge is a free data retrieval call binding the contract method 0x36c717c1.
// //
// Solidity: function l1TokenBridge() constant returns(address) // Solidity: function l1TokenBridge() view returns(address)
func (_L2StandardBridge *L2StandardBridgeSession) L1TokenBridge() (common.Address, error) { func (_L2StandardBridge *L2StandardBridgeSession) L1TokenBridge() (common.Address, error) {
return _L2StandardBridge.Contract.L1TokenBridge(&_L2StandardBridge.CallOpts) return _L2StandardBridge.Contract.L1TokenBridge(&_L2StandardBridge.CallOpts)
} }
// L1TokenBridge is a free data retrieval call binding the contract method 0x36c717c1. // L1TokenBridge is a free data retrieval call binding the contract method 0x36c717c1.
// //
// Solidity: function l1TokenBridge() constant returns(address) // Solidity: function l1TokenBridge() view returns(address)
func (_L2StandardBridge *L2StandardBridgeCallerSession) L1TokenBridge() (common.Address, error) { func (_L2StandardBridge *L2StandardBridgeCallerSession) L1TokenBridge() (common.Address, error) {
return _L2StandardBridge.Contract.L1TokenBridge(&_L2StandardBridge.CallOpts) return _L2StandardBridge.Contract.L1TokenBridge(&_L2StandardBridge.CallOpts)
} }
// Messenger is a free data retrieval call binding the contract method 0x3cb747bf. // Messenger is a free data retrieval call binding the contract method 0x3cb747bf.
// //
// Solidity: function messenger() constant returns(address) // Solidity: function messenger() view returns(address)
func (_L2StandardBridge *L2StandardBridgeCaller) Messenger(opts *bind.CallOpts) (common.Address, error) { func (_L2StandardBridge *L2StandardBridgeCaller) Messenger(opts *bind.CallOpts) (common.Address, error) {
var ( var out []interface{}
ret0 = new(common.Address) err := _L2StandardBridge.contract.Call(opts, &out, "messenger")
)
out := ret0 if err != nil {
err := _L2StandardBridge.contract.Call(opts, out, "messenger") return *new(common.Address), err
return *ret0, 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. // Messenger is a free data retrieval call binding the contract method 0x3cb747bf.
// //
// Solidity: function messenger() constant returns(address) // Solidity: function messenger() view returns(address)
func (_L2StandardBridge *L2StandardBridgeSession) Messenger() (common.Address, error) { func (_L2StandardBridge *L2StandardBridgeSession) Messenger() (common.Address, error) {
return _L2StandardBridge.Contract.Messenger(&_L2StandardBridge.CallOpts) return _L2StandardBridge.Contract.Messenger(&_L2StandardBridge.CallOpts)
} }
// Messenger is a free data retrieval call binding the contract method 0x3cb747bf. // Messenger is a free data retrieval call binding the contract method 0x3cb747bf.
// //
// Solidity: function messenger() constant returns(address) // Solidity: function messenger() view returns(address)
func (_L2StandardBridge *L2StandardBridgeCallerSession) Messenger() (common.Address, error) { func (_L2StandardBridge *L2StandardBridgeCallerSession) Messenger() (common.Address, error) {
return _L2StandardBridge.Contract.Messenger(&_L2StandardBridge.CallOpts) return _L2StandardBridge.Contract.Messenger(&_L2StandardBridge.CallOpts)
} }
...@@ -465,6 +487,7 @@ func (_L2StandardBridge *L2StandardBridgeFilterer) ParseDepositFailed(log types. ...@@ -465,6 +487,7 @@ func (_L2StandardBridge *L2StandardBridgeFilterer) ParseDepositFailed(log types.
if err := _L2StandardBridge.contract.UnpackLog(event, "DepositFailed", log); err != nil { if err := _L2StandardBridge.contract.UnpackLog(event, "DepositFailed", log); err != nil {
return nil, err return nil, err
} }
event.Raw = log
return event, nil return event, nil
} }
...@@ -629,6 +652,7 @@ func (_L2StandardBridge *L2StandardBridgeFilterer) ParseDepositFinalized(log typ ...@@ -629,6 +652,7 @@ func (_L2StandardBridge *L2StandardBridgeFilterer) ParseDepositFinalized(log typ
if err := _L2StandardBridge.contract.UnpackLog(event, "DepositFinalized", log); err != nil { if err := _L2StandardBridge.contract.UnpackLog(event, "DepositFinalized", log); err != nil {
return nil, err return nil, err
} }
event.Raw = log
return event, nil return event, nil
} }
...@@ -793,5 +817,6 @@ func (_L2StandardBridge *L2StandardBridgeFilterer) ParseWithdrawalInitiated(log ...@@ -793,5 +817,6 @@ func (_L2StandardBridge *L2StandardBridgeFilterer) ParseWithdrawalInitiated(log
if err := _L2StandardBridge.contract.UnpackLog(event, "WithdrawalInitiated", log); err != nil { if err := _L2StandardBridge.contract.UnpackLog(event, "WithdrawalInitiated", log); err != nil {
return nil, err return nil, err
} }
event.Raw = log
return event, nil return event, nil
} }
...@@ -4,43 +4,55 @@ ...@@ -4,43 +4,55 @@
package l2erc20 package l2erc20
import ( import (
"errors"
"math/big" "math/big"
"strings" "strings"
ethereum "github.com/ethereum-optimism/optimism/l2geth" ethereum "github.com/ethereum/go-ethereum"
"github.com/ethereum-optimism/optimism/l2geth/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum-optimism/optimism/l2geth/accounts/abi/bind" "github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum-optimism/optimism/l2geth/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum-optimism/optimism/l2geth/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum-optimism/optimism/l2geth/event" "github.com/ethereum/go-ethereum/event"
) )
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
var ( var (
_ = errors.New
_ = big.NewInt _ = big.NewInt
_ = strings.NewReader _ = strings.NewReader
_ = ethereum.NotFound _ = ethereum.NotFound
_ = abi.U256
_ = bind.Bind _ = bind.Bind
_ = common.Big1 _ = common.Big1
_ = types.BloomLookup _ = types.BloomLookup
_ = event.NewSubscription _ = event.NewSubscription
) )
// L2ERC20MetaData contains all meta data concerning the L2ERC20 contract.
var L2ERC20MetaData = &bind.MetaData{
ABI: "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_initialAmount\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"_tokenName\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"_decimalUnits\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"_tokenSymbol\",\"type\":\"string\"}],\"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\":\"_from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"remaining\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"allowed\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"balances\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"destroy\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"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\":\"_value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]",
Bin: "0x60806040523480156200001157600080fd5b5060405162000a0c38038062000a0c833981016040819052620000349162000203565b336000908152602081815260409091208590556005859055835162000060916002919086019062000090565b506003805460ff191660ff841617905580516200008590600490602084019062000090565b5050505050620002cf565b8280546200009e9062000292565b90600052602060002090601f016020900481019282620000c257600085556200010d565b82601f10620000dd57805160ff19168380011785556200010d565b828001600101855582156200010d579182015b828111156200010d578251825591602001919060010190620000f0565b506200011b9291506200011f565b5090565b5b808211156200011b576000815560010162000120565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200015e57600080fd5b81516001600160401b03808211156200017b576200017b62000136565b604051601f8301601f19908116603f01168101908282118183101715620001a657620001a662000136565b81604052838152602092508683858801011115620001c357600080fd5b600091505b83821015620001e75785820183015181830184015290820190620001c8565b83821115620001f95760008385830101525b9695505050505050565b600080600080608085870312156200021a57600080fd5b845160208601519094506001600160401b03808211156200023a57600080fd5b62000248888389016200014c565b94506040870151915060ff821682146200026157600080fd5b6060870151919350808211156200027757600080fd5b5062000286878288016200014c565b91505092959194509250565b600181811c90821680620002a757607f821691505b60208210811415620002c957634e487b7160e01b600052602260045260246000fd5b50919050565b61072d80620002df6000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c80635c658165116100715780635c6581651461016357806370a082311461018e57806383197ef0146101b757806395d89b41146101bf578063a9059cbb146101c7578063dd62ed3e146101da57600080fd5b806306fdde03146100b9578063095ea7b3146100d757806318160ddd146100fa57806323b872dd1461011157806327e235e314610124578063313ce56714610144575b600080fd5b6100c1610213565b6040516100ce9190610574565b60405180910390f35b6100ea6100e53660046105e5565b6102a1565b60405190151581526020016100ce565b61010360055481565b6040519081526020016100ce565b6100ea61011f36600461060f565b61030d565b61010361013236600461064b565b60006020819052908152604090205481565b6003546101519060ff1681565b60405160ff90911681526020016100ce565b61010361017136600461066d565b600160209081526000928352604080842090915290825290205481565b61010361019c36600461064b565b6001600160a01b031660009081526020819052604090205490565b6101bd33ff5b005b6100c1610483565b6100ea6101d53660046105e5565b610490565b6101036101e836600461066d565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60028054610220906106a0565b80601f016020809104026020016040519081016040528092919081815260200182805461024c906106a0565b80156102995780601f1061026e57610100808354040283529160200191610299565b820191906000526020600020905b81548152906001019060200180831161027c57829003601f168201915b505050505081565b3360008181526001602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906102fc9086815260200190565b60405180910390a350600192915050565b6001600160a01b038316600081815260016020908152604080832033845282528083205493835290829052812054909190831180159061034d5750828110155b61038e5760405162461bcd60e51b815260206004820152600d60248201526c62616420616c6c6f77616e636560981b60448201526064015b60405180910390fd5b6001600160a01b038416600090815260208190526040812080548592906103b69084906106f1565b90915550506001600160a01b038516600090815260208190526040812080548592906103e3908490610709565b909155505060001981101561042b576001600160a01b038516600090815260016020908152604080832033845290915281208054859290610425908490610709565b90915550505b836001600160a01b0316856001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161047091815260200190565b60405180910390a3506001949350505050565b60048054610220906106a0565b336000908152602081905260408120548211156104e65760405162461bcd60e51b8152602060048201526014602482015273696e73756666696369656e742062616c616e636560601b6044820152606401610385565b3360009081526020819052604081208054849290610505908490610709565b90915550506001600160a01b038316600090815260208190526040812080548492906105329084906106f1565b90915550506040518281526001600160a01b0384169033907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020016102fc565b600060208083528351808285015260005b818110156105a157858101830151858201604001528201610585565b818111156105b3576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b03811681146105e057600080fd5b919050565b600080604083850312156105f857600080fd5b610601836105c9565b946020939093013593505050565b60008060006060848603121561062457600080fd5b61062d846105c9565b925061063b602085016105c9565b9150604084013590509250925092565b60006020828403121561065d57600080fd5b610666826105c9565b9392505050565b6000806040838503121561068057600080fd5b610689836105c9565b9150610697602084016105c9565b90509250929050565b600181811c908216806106b457607f821691505b602082108114156106d557634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60008219821115610704576107046106db565b500190565b60008282101561071b5761071b6106db565b50039056fea164736f6c6343000809000a",
}
// L2ERC20ABI is the input ABI used to generate the binding from. // L2ERC20ABI is the input ABI used to generate the binding from.
const L2ERC20ABI = "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_initialAmount\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"_tokenName\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"_decimalUnits\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"_tokenSymbol\",\"type\":\"string\"}],\"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\":\"_from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"remaining\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"allowed\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"balances\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"destroy\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"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\":\"_value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" // Deprecated: Use L2ERC20MetaData.ABI instead.
var L2ERC20ABI = L2ERC20MetaData.ABI
// L2ERC20Bin is the compiled bytecode used for deploying new contracts. // L2ERC20Bin is the compiled bytecode used for deploying new contracts.
var L2ERC20Bin = "0x60806040523480156200001157600080fd5b5060405162000a0c38038062000a0c833981016040819052620000349162000203565b336000908152602081815260409091208590556005859055835162000060916002919086019062000090565b506003805460ff191660ff841617905580516200008590600490602084019062000090565b5050505050620002cf565b8280546200009e9062000292565b90600052602060002090601f016020900481019282620000c257600085556200010d565b82601f10620000dd57805160ff19168380011785556200010d565b828001600101855582156200010d579182015b828111156200010d578251825591602001919060010190620000f0565b506200011b9291506200011f565b5090565b5b808211156200011b576000815560010162000120565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200015e57600080fd5b81516001600160401b03808211156200017b576200017b62000136565b604051601f8301601f19908116603f01168101908282118183101715620001a657620001a662000136565b81604052838152602092508683858801011115620001c357600080fd5b600091505b83821015620001e75785820183015181830184015290820190620001c8565b83821115620001f95760008385830101525b9695505050505050565b600080600080608085870312156200021a57600080fd5b845160208601519094506001600160401b03808211156200023a57600080fd5b62000248888389016200014c565b94506040870151915060ff821682146200026157600080fd5b6060870151919350808211156200027757600080fd5b5062000286878288016200014c565b91505092959194509250565b600181811c90821680620002a757607f821691505b60208210811415620002c957634e487b7160e01b600052602260045260246000fd5b50919050565b61072d80620002df6000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c80635c658165116100715780635c6581651461016357806370a082311461018e57806383197ef0146101b757806395d89b41146101bf578063a9059cbb146101c7578063dd62ed3e146101da57600080fd5b806306fdde03146100b9578063095ea7b3146100d757806318160ddd146100fa57806323b872dd1461011157806327e235e314610124578063313ce56714610144575b600080fd5b6100c1610213565b6040516100ce9190610574565b60405180910390f35b6100ea6100e53660046105e5565b6102a1565b60405190151581526020016100ce565b61010360055481565b6040519081526020016100ce565b6100ea61011f36600461060f565b61030d565b61010361013236600461064b565b60006020819052908152604090205481565b6003546101519060ff1681565b60405160ff90911681526020016100ce565b61010361017136600461066d565b600160209081526000928352604080842090915290825290205481565b61010361019c36600461064b565b6001600160a01b031660009081526020819052604090205490565b6101bd33ff5b005b6100c1610483565b6100ea6101d53660046105e5565b610490565b6101036101e836600461066d565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60028054610220906106a0565b80601f016020809104026020016040519081016040528092919081815260200182805461024c906106a0565b80156102995780601f1061026e57610100808354040283529160200191610299565b820191906000526020600020905b81548152906001019060200180831161027c57829003601f168201915b505050505081565b3360008181526001602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906102fc9086815260200190565b60405180910390a350600192915050565b6001600160a01b038316600081815260016020908152604080832033845282528083205493835290829052812054909190831180159061034d5750828110155b61038e5760405162461bcd60e51b815260206004820152600d60248201526c62616420616c6c6f77616e636560981b60448201526064015b60405180910390fd5b6001600160a01b038416600090815260208190526040812080548592906103b69084906106f1565b90915550506001600160a01b038516600090815260208190526040812080548592906103e3908490610709565b909155505060001981101561042b576001600160a01b038516600090815260016020908152604080832033845290915281208054859290610425908490610709565b90915550505b836001600160a01b0316856001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161047091815260200190565b60405180910390a3506001949350505050565b60048054610220906106a0565b336000908152602081905260408120548211156104e65760405162461bcd60e51b8152602060048201526014602482015273696e73756666696369656e742062616c616e636560601b6044820152606401610385565b3360009081526020819052604081208054849290610505908490610709565b90915550506001600160a01b038316600090815260208190526040812080548492906105329084906106f1565b90915550506040518281526001600160a01b0384169033907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020016102fc565b600060208083528351808285015260005b818110156105a157858101830151858201604001528201610585565b818111156105b3576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b03811681146105e057600080fd5b919050565b600080604083850312156105f857600080fd5b610601836105c9565b946020939093013593505050565b60008060006060848603121561062457600080fd5b61062d846105c9565b925061063b602085016105c9565b9150604084013590509250925092565b60006020828403121561065d57600080fd5b610666826105c9565b9392505050565b6000806040838503121561068057600080fd5b610689836105c9565b9150610697602084016105c9565b90509250929050565b600181811c908216806106b457607f821691505b602082108114156106d557634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60008219821115610704576107046106db565b500190565b60008282101561071b5761071b6106db565b50039056fea164736f6c6343000809000a" // Deprecated: Use L2ERC20MetaData.Bin instead.
var L2ERC20Bin = L2ERC20MetaData.Bin
// DeployL2ERC20 deploys a new Ethereum contract, binding an instance of L2ERC20 to it. // DeployL2ERC20 deploys a new Ethereum contract, binding an instance of L2ERC20 to it.
func DeployL2ERC20(auth *bind.TransactOpts, backend bind.ContractBackend, _initialAmount *big.Int, _tokenName string, _decimalUnits uint8, _tokenSymbol string) (common.Address, *types.Transaction, *L2ERC20, error) { func DeployL2ERC20(auth *bind.TransactOpts, backend bind.ContractBackend, _initialAmount *big.Int, _tokenName string, _decimalUnits uint8, _tokenSymbol string) (common.Address, *types.Transaction, *L2ERC20, error) {
parsed, err := abi.JSON(strings.NewReader(L2ERC20ABI)) parsed, err := L2ERC20MetaData.GetAbi()
if err != nil { if err != nil {
return common.Address{}, nil, nil, err 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(L2ERC20Bin), backend, _initialAmount, _tokenName, _decimalUnits, _tokenSymbol) address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(L2ERC20Bin), backend, _initialAmount, _tokenName, _decimalUnits, _tokenSymbol)
if err != nil { if err != nil {
return common.Address{}, nil, nil, err return common.Address{}, nil, nil, err
} }
...@@ -155,7 +167,7 @@ func bindL2ERC20(address common.Address, caller bind.ContractCaller, transactor ...@@ -155,7 +167,7 @@ func bindL2ERC20(address common.Address, caller bind.ContractCaller, transactor
// sets the output to result. The result type might be a single field for simple // 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, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_L2ERC20 *L2ERC20Raw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_L2ERC20 *L2ERC20Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _L2ERC20.Contract.L2ERC20Caller.contract.Call(opts, result, method, params...) return _L2ERC20.Contract.L2ERC20Caller.contract.Call(opts, result, method, params...)
} }
...@@ -174,7 +186,7 @@ func (_L2ERC20 *L2ERC20Raw) Transact(opts *bind.TransactOpts, method string, par ...@@ -174,7 +186,7 @@ func (_L2ERC20 *L2ERC20Raw) Transact(opts *bind.TransactOpts, method string, par
// sets the output to result. The result type might be a single field for simple // 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, a slice of interfaces for anonymous returns and a struct for named
// returns. // returns.
func (_L2ERC20 *L2ERC20CallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { func (_L2ERC20 *L2ERC20CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _L2ERC20.Contract.contract.Call(opts, result, method, params...) return _L2ERC20.Contract.contract.Call(opts, result, method, params...)
} }
...@@ -191,208 +203,248 @@ func (_L2ERC20 *L2ERC20TransactorRaw) Transact(opts *bind.TransactOpts, method s ...@@ -191,208 +203,248 @@ func (_L2ERC20 *L2ERC20TransactorRaw) Transact(opts *bind.TransactOpts, method s
// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e.
// //
// Solidity: function allowance(address _owner, address _spender) constant returns(uint256 remaining) // Solidity: function allowance(address _owner, address _spender) view returns(uint256 remaining)
func (_L2ERC20 *L2ERC20Caller) Allowance(opts *bind.CallOpts, _owner common.Address, _spender common.Address) (*big.Int, error) { func (_L2ERC20 *L2ERC20Caller) Allowance(opts *bind.CallOpts, _owner common.Address, _spender common.Address) (*big.Int, error) {
var ( var out []interface{}
ret0 = new(*big.Int) err := _L2ERC20.contract.Call(opts, &out, "allowance", _owner, _spender)
)
out := ret0 if err != nil {
err := _L2ERC20.contract.Call(opts, out, "allowance", _owner, _spender) return *new(*big.Int), err
return *ret0, 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. // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e.
// //
// Solidity: function allowance(address _owner, address _spender) constant returns(uint256 remaining) // Solidity: function allowance(address _owner, address _spender) view returns(uint256 remaining)
func (_L2ERC20 *L2ERC20Session) Allowance(_owner common.Address, _spender common.Address) (*big.Int, error) { func (_L2ERC20 *L2ERC20Session) Allowance(_owner common.Address, _spender common.Address) (*big.Int, error) {
return _L2ERC20.Contract.Allowance(&_L2ERC20.CallOpts, _owner, _spender) return _L2ERC20.Contract.Allowance(&_L2ERC20.CallOpts, _owner, _spender)
} }
// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e.
// //
// Solidity: function allowance(address _owner, address _spender) constant returns(uint256 remaining) // Solidity: function allowance(address _owner, address _spender) view returns(uint256 remaining)
func (_L2ERC20 *L2ERC20CallerSession) Allowance(_owner common.Address, _spender common.Address) (*big.Int, error) { func (_L2ERC20 *L2ERC20CallerSession) Allowance(_owner common.Address, _spender common.Address) (*big.Int, error) {
return _L2ERC20.Contract.Allowance(&_L2ERC20.CallOpts, _owner, _spender) return _L2ERC20.Contract.Allowance(&_L2ERC20.CallOpts, _owner, _spender)
} }
// Allowed is a free data retrieval call binding the contract method 0x5c658165. // Allowed is a free data retrieval call binding the contract method 0x5c658165.
// //
// Solidity: function allowed(address , address ) constant returns(uint256) // Solidity: function allowed(address , address ) view returns(uint256)
func (_L2ERC20 *L2ERC20Caller) Allowed(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address) (*big.Int, error) { func (_L2ERC20 *L2ERC20Caller) Allowed(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address) (*big.Int, error) {
var ( var out []interface{}
ret0 = new(*big.Int) err := _L2ERC20.contract.Call(opts, &out, "allowed", arg0, arg1)
)
out := ret0 if err != nil {
err := _L2ERC20.contract.Call(opts, out, "allowed", arg0, arg1) return *new(*big.Int), err
return *ret0, err }
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
return out0, err
} }
// Allowed is a free data retrieval call binding the contract method 0x5c658165. // Allowed is a free data retrieval call binding the contract method 0x5c658165.
// //
// Solidity: function allowed(address , address ) constant returns(uint256) // Solidity: function allowed(address , address ) view returns(uint256)
func (_L2ERC20 *L2ERC20Session) Allowed(arg0 common.Address, arg1 common.Address) (*big.Int, error) { func (_L2ERC20 *L2ERC20Session) Allowed(arg0 common.Address, arg1 common.Address) (*big.Int, error) {
return _L2ERC20.Contract.Allowed(&_L2ERC20.CallOpts, arg0, arg1) return _L2ERC20.Contract.Allowed(&_L2ERC20.CallOpts, arg0, arg1)
} }
// Allowed is a free data retrieval call binding the contract method 0x5c658165. // Allowed is a free data retrieval call binding the contract method 0x5c658165.
// //
// Solidity: function allowed(address , address ) constant returns(uint256) // Solidity: function allowed(address , address ) view returns(uint256)
func (_L2ERC20 *L2ERC20CallerSession) Allowed(arg0 common.Address, arg1 common.Address) (*big.Int, error) { func (_L2ERC20 *L2ERC20CallerSession) Allowed(arg0 common.Address, arg1 common.Address) (*big.Int, error) {
return _L2ERC20.Contract.Allowed(&_L2ERC20.CallOpts, arg0, arg1) return _L2ERC20.Contract.Allowed(&_L2ERC20.CallOpts, arg0, arg1)
} }
// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // BalanceOf is a free data retrieval call binding the contract method 0x70a08231.
// //
// Solidity: function balanceOf(address _owner) constant returns(uint256 balance) // Solidity: function balanceOf(address _owner) view returns(uint256 balance)
func (_L2ERC20 *L2ERC20Caller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) { func (_L2ERC20 *L2ERC20Caller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {
var ( var out []interface{}
ret0 = new(*big.Int) err := _L2ERC20.contract.Call(opts, &out, "balanceOf", _owner)
)
out := ret0 if err != nil {
err := _L2ERC20.contract.Call(opts, out, "balanceOf", _owner) return *new(*big.Int), err
return *ret0, 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. // BalanceOf is a free data retrieval call binding the contract method 0x70a08231.
// //
// Solidity: function balanceOf(address _owner) constant returns(uint256 balance) // Solidity: function balanceOf(address _owner) view returns(uint256 balance)
func (_L2ERC20 *L2ERC20Session) BalanceOf(_owner common.Address) (*big.Int, error) { func (_L2ERC20 *L2ERC20Session) BalanceOf(_owner common.Address) (*big.Int, error) {
return _L2ERC20.Contract.BalanceOf(&_L2ERC20.CallOpts, _owner) return _L2ERC20.Contract.BalanceOf(&_L2ERC20.CallOpts, _owner)
} }
// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // BalanceOf is a free data retrieval call binding the contract method 0x70a08231.
// //
// Solidity: function balanceOf(address _owner) constant returns(uint256 balance) // Solidity: function balanceOf(address _owner) view returns(uint256 balance)
func (_L2ERC20 *L2ERC20CallerSession) BalanceOf(_owner common.Address) (*big.Int, error) { func (_L2ERC20 *L2ERC20CallerSession) BalanceOf(_owner common.Address) (*big.Int, error) {
return _L2ERC20.Contract.BalanceOf(&_L2ERC20.CallOpts, _owner) return _L2ERC20.Contract.BalanceOf(&_L2ERC20.CallOpts, _owner)
} }
// Balances is a free data retrieval call binding the contract method 0x27e235e3. // Balances is a free data retrieval call binding the contract method 0x27e235e3.
// //
// Solidity: function balances(address ) constant returns(uint256) // Solidity: function balances(address ) view returns(uint256)
func (_L2ERC20 *L2ERC20Caller) Balances(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { func (_L2ERC20 *L2ERC20Caller) Balances(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) {
var ( var out []interface{}
ret0 = new(*big.Int) err := _L2ERC20.contract.Call(opts, &out, "balances", arg0)
)
out := ret0 if err != nil {
err := _L2ERC20.contract.Call(opts, out, "balances", arg0) return *new(*big.Int), err
return *ret0, err }
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
return out0, err
} }
// Balances is a free data retrieval call binding the contract method 0x27e235e3. // Balances is a free data retrieval call binding the contract method 0x27e235e3.
// //
// Solidity: function balances(address ) constant returns(uint256) // Solidity: function balances(address ) view returns(uint256)
func (_L2ERC20 *L2ERC20Session) Balances(arg0 common.Address) (*big.Int, error) { func (_L2ERC20 *L2ERC20Session) Balances(arg0 common.Address) (*big.Int, error) {
return _L2ERC20.Contract.Balances(&_L2ERC20.CallOpts, arg0) return _L2ERC20.Contract.Balances(&_L2ERC20.CallOpts, arg0)
} }
// Balances is a free data retrieval call binding the contract method 0x27e235e3. // Balances is a free data retrieval call binding the contract method 0x27e235e3.
// //
// Solidity: function balances(address ) constant returns(uint256) // Solidity: function balances(address ) view returns(uint256)
func (_L2ERC20 *L2ERC20CallerSession) Balances(arg0 common.Address) (*big.Int, error) { func (_L2ERC20 *L2ERC20CallerSession) Balances(arg0 common.Address) (*big.Int, error) {
return _L2ERC20.Contract.Balances(&_L2ERC20.CallOpts, arg0) return _L2ERC20.Contract.Balances(&_L2ERC20.CallOpts, arg0)
} }
// Decimals is a free data retrieval call binding the contract method 0x313ce567. // Decimals is a free data retrieval call binding the contract method 0x313ce567.
// //
// Solidity: function decimals() constant returns(uint8) // Solidity: function decimals() view returns(uint8)
func (_L2ERC20 *L2ERC20Caller) Decimals(opts *bind.CallOpts) (uint8, error) { func (_L2ERC20 *L2ERC20Caller) Decimals(opts *bind.CallOpts) (uint8, error) {
var ( var out []interface{}
ret0 = new(uint8) err := _L2ERC20.contract.Call(opts, &out, "decimals")
)
out := ret0 if err != nil {
err := _L2ERC20.contract.Call(opts, out, "decimals") return *new(uint8), err
return *ret0, err }
out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8)
return out0, err
} }
// Decimals is a free data retrieval call binding the contract method 0x313ce567. // Decimals is a free data retrieval call binding the contract method 0x313ce567.
// //
// Solidity: function decimals() constant returns(uint8) // Solidity: function decimals() view returns(uint8)
func (_L2ERC20 *L2ERC20Session) Decimals() (uint8, error) { func (_L2ERC20 *L2ERC20Session) Decimals() (uint8, error) {
return _L2ERC20.Contract.Decimals(&_L2ERC20.CallOpts) return _L2ERC20.Contract.Decimals(&_L2ERC20.CallOpts)
} }
// Decimals is a free data retrieval call binding the contract method 0x313ce567. // Decimals is a free data retrieval call binding the contract method 0x313ce567.
// //
// Solidity: function decimals() constant returns(uint8) // Solidity: function decimals() view returns(uint8)
func (_L2ERC20 *L2ERC20CallerSession) Decimals() (uint8, error) { func (_L2ERC20 *L2ERC20CallerSession) Decimals() (uint8, error) {
return _L2ERC20.Contract.Decimals(&_L2ERC20.CallOpts) return _L2ERC20.Contract.Decimals(&_L2ERC20.CallOpts)
} }
// Name is a free data retrieval call binding the contract method 0x06fdde03. // Name is a free data retrieval call binding the contract method 0x06fdde03.
// //
// Solidity: function name() constant returns(string) // Solidity: function name() view returns(string)
func (_L2ERC20 *L2ERC20Caller) Name(opts *bind.CallOpts) (string, error) { func (_L2ERC20 *L2ERC20Caller) Name(opts *bind.CallOpts) (string, error) {
var ( var out []interface{}
ret0 = new(string) err := _L2ERC20.contract.Call(opts, &out, "name")
)
out := ret0 if err != nil {
err := _L2ERC20.contract.Call(opts, out, "name") return *new(string), err
return *ret0, err }
out0 := *abi.ConvertType(out[0], new(string)).(*string)
return out0, err
} }
// Name is a free data retrieval call binding the contract method 0x06fdde03. // Name is a free data retrieval call binding the contract method 0x06fdde03.
// //
// Solidity: function name() constant returns(string) // Solidity: function name() view returns(string)
func (_L2ERC20 *L2ERC20Session) Name() (string, error) { func (_L2ERC20 *L2ERC20Session) Name() (string, error) {
return _L2ERC20.Contract.Name(&_L2ERC20.CallOpts) return _L2ERC20.Contract.Name(&_L2ERC20.CallOpts)
} }
// Name is a free data retrieval call binding the contract method 0x06fdde03. // Name is a free data retrieval call binding the contract method 0x06fdde03.
// //
// Solidity: function name() constant returns(string) // Solidity: function name() view returns(string)
func (_L2ERC20 *L2ERC20CallerSession) Name() (string, error) { func (_L2ERC20 *L2ERC20CallerSession) Name() (string, error) {
return _L2ERC20.Contract.Name(&_L2ERC20.CallOpts) return _L2ERC20.Contract.Name(&_L2ERC20.CallOpts)
} }
// Symbol is a free data retrieval call binding the contract method 0x95d89b41. // Symbol is a free data retrieval call binding the contract method 0x95d89b41.
// //
// Solidity: function symbol() constant returns(string) // Solidity: function symbol() view returns(string)
func (_L2ERC20 *L2ERC20Caller) Symbol(opts *bind.CallOpts) (string, error) { func (_L2ERC20 *L2ERC20Caller) Symbol(opts *bind.CallOpts) (string, error) {
var ( var out []interface{}
ret0 = new(string) err := _L2ERC20.contract.Call(opts, &out, "symbol")
)
out := ret0 if err != nil {
err := _L2ERC20.contract.Call(opts, out, "symbol") return *new(string), err
return *ret0, err }
out0 := *abi.ConvertType(out[0], new(string)).(*string)
return out0, err
} }
// Symbol is a free data retrieval call binding the contract method 0x95d89b41. // Symbol is a free data retrieval call binding the contract method 0x95d89b41.
// //
// Solidity: function symbol() constant returns(string) // Solidity: function symbol() view returns(string)
func (_L2ERC20 *L2ERC20Session) Symbol() (string, error) { func (_L2ERC20 *L2ERC20Session) Symbol() (string, error) {
return _L2ERC20.Contract.Symbol(&_L2ERC20.CallOpts) return _L2ERC20.Contract.Symbol(&_L2ERC20.CallOpts)
} }
// Symbol is a free data retrieval call binding the contract method 0x95d89b41. // Symbol is a free data retrieval call binding the contract method 0x95d89b41.
// //
// Solidity: function symbol() constant returns(string) // Solidity: function symbol() view returns(string)
func (_L2ERC20 *L2ERC20CallerSession) Symbol() (string, error) { func (_L2ERC20 *L2ERC20CallerSession) Symbol() (string, error) {
return _L2ERC20.Contract.Symbol(&_L2ERC20.CallOpts) return _L2ERC20.Contract.Symbol(&_L2ERC20.CallOpts)
} }
// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd.
// //
// Solidity: function totalSupply() constant returns(uint256) // Solidity: function totalSupply() view returns(uint256)
func (_L2ERC20 *L2ERC20Caller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { func (_L2ERC20 *L2ERC20Caller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) {
var ( var out []interface{}
ret0 = new(*big.Int) err := _L2ERC20.contract.Call(opts, &out, "totalSupply")
)
out := ret0 if err != nil {
err := _L2ERC20.contract.Call(opts, out, "totalSupply") return *new(*big.Int), err
return *ret0, 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. // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd.
// //
// Solidity: function totalSupply() constant returns(uint256) // Solidity: function totalSupply() view returns(uint256)
func (_L2ERC20 *L2ERC20Session) TotalSupply() (*big.Int, error) { func (_L2ERC20 *L2ERC20Session) TotalSupply() (*big.Int, error) {
return _L2ERC20.Contract.TotalSupply(&_L2ERC20.CallOpts) return _L2ERC20.Contract.TotalSupply(&_L2ERC20.CallOpts)
} }
// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd.
// //
// Solidity: function totalSupply() constant returns(uint256) // Solidity: function totalSupply() view returns(uint256)
func (_L2ERC20 *L2ERC20CallerSession) TotalSupply() (*big.Int, error) { func (_L2ERC20 *L2ERC20CallerSession) TotalSupply() (*big.Int, error) {
return _L2ERC20.Contract.TotalSupply(&_L2ERC20.CallOpts) return _L2ERC20.Contract.TotalSupply(&_L2ERC20.CallOpts)
} }
...@@ -631,6 +683,7 @@ func (_L2ERC20 *L2ERC20Filterer) ParseApproval(log types.Log) (*L2ERC20Approval, ...@@ -631,6 +683,7 @@ func (_L2ERC20 *L2ERC20Filterer) ParseApproval(log types.Log) (*L2ERC20Approval,
if err := _L2ERC20.contract.UnpackLog(event, "Approval", log); err != nil { if err := _L2ERC20.contract.UnpackLog(event, "Approval", log); err != nil {
return nil, err return nil, err
} }
event.Raw = log
return event, nil return event, nil
} }
...@@ -784,5 +837,6 @@ func (_L2ERC20 *L2ERC20Filterer) ParseTransfer(log types.Log) (*L2ERC20Transfer, ...@@ -784,5 +837,6 @@ func (_L2ERC20 *L2ERC20Filterer) ParseTransfer(log types.Log) (*L2ERC20Transfer,
if err := _L2ERC20.contract.UnpackLog(event, "Transfer", log); err != nil { if err := _L2ERC20.contract.UnpackLog(event, "Transfer", log); err != nil {
return nil, err return nil, err
} }
event.Raw = log
return event, nil return event, nil
} }
...@@ -7,8 +7,8 @@ import ( ...@@ -7,8 +7,8 @@ import (
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
) )
// ParseL1Address parses a L1 ETH addres from a hex string. This method will // ParseL1Address parses a L1 ETH address from a hex string. This method will
// fail if the address is not a valid hexidecimal address. // fail if the address is not a valid hexadecimal address.
func ParseL1Address(address string) (common.Address, error) { func ParseL1Address(address string) (common.Address, error) {
if common.IsHexAddress(address) { if common.IsHexAddress(address) {
return common.HexToAddress(address), nil return common.HexToAddress(address), nil
...@@ -16,8 +16,8 @@ func ParseL1Address(address string) (common.Address, error) { ...@@ -16,8 +16,8 @@ func ParseL1Address(address string) (common.Address, error) {
return common.Address{}, fmt.Errorf("invalid address: %v", address) return common.Address{}, fmt.Errorf("invalid address: %v", address)
} }
// ParseL2Address parses a L2 ETH addres from a hex string. This method will // ParseL2Address parses a L2 ETH address from a hex string. This method will
// fail if the address is not a valid hexidecimal address. // fail if the address is not a valid hexadecimal address.
func ParseL2Address(address string) (l2common.Address, error) { func ParseL2Address(address string) (l2common.Address, error) {
if l2common.IsHexAddress(address) { if l2common.IsHexAddress(address) {
return l2common.HexToAddress(address), nil return l2common.HexToAddress(address), nil
......
...@@ -12,7 +12,7 @@ import ( ...@@ -12,7 +12,7 @@ import (
) )
// TestParseL1Address asserts that ParseL1Address correctly parses // TestParseL1Address asserts that ParseL1Address correctly parses
// 40-characater hexidecimal strings with optional 0x prefix into valid 20-byte // 40-characater hexadecimal strings with optional 0x prefix into valid 20-byte
// addresses for the L1 chain. // addresses for the L1 chain.
func TestParseL1Address(t *testing.T) { func TestParseL1Address(t *testing.T) {
tests := []struct { tests := []struct {
...@@ -57,7 +57,7 @@ func TestParseL1Address(t *testing.T) { ...@@ -57,7 +57,7 @@ func TestParseL1Address(t *testing.T) {
} }
// TestParseL2Address asserts that ParseL2Address correctly parses // TestParseL2Address asserts that ParseL2Address correctly parses
// 40-characater hexidecimal strings with optional 0x prefix into valid 20-byte // 40-characater hexadecimal strings with optional 0x prefix into valid 20-byte
// addresses for the L2 chain. // addresses for the L2 chain.
func TestParseL2Address(t *testing.T) { func TestParseL2Address(t *testing.T) {
tests := []struct { tests := []struct {
......
...@@ -6,7 +6,6 @@ import ( ...@@ -6,7 +6,6 @@ import (
"fmt" "fmt"
"strings" "strings"
l2common "github.com/ethereum-optimism/optimism/l2geth/common"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
// NOTE: Only postgresql backend is supported at the moment. // NOTE: Only postgresql backend is supported at the moment.
...@@ -401,7 +400,7 @@ func (d *Database) GetDepositsByAddress(address common.Address, page PaginationP ...@@ -401,7 +400,7 @@ func (d *Database) GetDepositsByAddress(address common.Address, page PaginationP
// GetWithdrawalBatch returns the StateBatch corresponding to the given // GetWithdrawalBatch returns the StateBatch corresponding to the given
// withdrawal transaction hash. // withdrawal transaction hash.
func (d *Database) GetWithdrawalBatch(hash l2common.Hash) (*StateBatchJSON, error) { func (d *Database) GetWithdrawalBatch(hash common.Hash) (*StateBatchJSON, error) {
const selectWithdrawalBatchStatement = ` const selectWithdrawalBatchStatement = `
SELECT SELECT
state_batches.index, state_batches.root, state_batches.size, state_batches.prev_total, state_batches.extra_data, state_batches.block_hash, state_batches.index, state_batches.root, state_batches.size, state_batches.prev_total, state_batches.extra_data, state_batches.block_hash,
...@@ -459,7 +458,7 @@ func (d *Database) GetWithdrawalBatch(hash l2common.Hash) (*StateBatchJSON, erro ...@@ -459,7 +458,7 @@ func (d *Database) GetWithdrawalBatch(hash l2common.Hash) (*StateBatchJSON, erro
// GetWithdrawalsByAddress returns the list of Withdrawals indexed for the given // GetWithdrawalsByAddress returns the list of Withdrawals indexed for the given
// address paginated by the given params. // address paginated by the given params.
func (d *Database) GetWithdrawalsByAddress(address l2common.Address, page PaginationParam) (*PaginatedWithdrawals, error) { func (d *Database) GetWithdrawalsByAddress(address common.Address, page PaginationParam) (*PaginatedWithdrawals, error) {
const selectWithdrawalsStatement = ` const selectWithdrawalsStatement = `
SELECT SELECT
withdrawals.guid, withdrawals.from_address, withdrawals.to_address, withdrawals.guid, withdrawals.from_address, withdrawals.to_address,
...@@ -505,7 +504,7 @@ func (d *Database) GetWithdrawalsByAddress(address l2common.Address, page Pagina ...@@ -505,7 +504,7 @@ func (d *Database) GetWithdrawalsByAddress(address l2common.Address, page Pagina
} }
for i := range withdrawals { for i := range withdrawals {
batch, _ := d.GetWithdrawalBatch(l2common.HexToHash(withdrawals[i].TxHash)) batch, _ := d.GetWithdrawalBatch(common.HexToHash(withdrawals[i].TxHash))
withdrawals[i].Batch = batch withdrawals[i].Batch = batch
} }
...@@ -540,12 +539,12 @@ func (d *Database) GetWithdrawalsByAddress(address l2common.Address, page Pagina ...@@ -540,12 +539,12 @@ func (d *Database) GetWithdrawalsByAddress(address l2common.Address, page Pagina
} }
// GetHighestL1Block returns the highest known L1 block. // GetHighestL1Block returns the highest known L1 block.
func (d *Database) GetHighestL1Block() (*L1BlockLocator, error) { func (d *Database) GetHighestL1Block() (*BlockLocator, error) {
const selectHighestBlockStatement = ` const selectHighestBlockStatement = `
SELECT number, hash FROM l1_blocks ORDER BY number DESC LIMIT 1 SELECT number, hash FROM l1_blocks ORDER BY number DESC LIMIT 1
` `
var highestBlock *L1BlockLocator var highestBlock *BlockLocator
err := txn(d.db, func(tx *sql.Tx) error { err := txn(d.db, func(tx *sql.Tx) error {
row := tx.QueryRow(selectHighestBlockStatement) row := tx.QueryRow(selectHighestBlockStatement)
if row.Err() != nil { if row.Err() != nil {
...@@ -563,7 +562,7 @@ func (d *Database) GetHighestL1Block() (*L1BlockLocator, error) { ...@@ -563,7 +562,7 @@ func (d *Database) GetHighestL1Block() (*L1BlockLocator, error) {
return err return err
} }
highestBlock = &L1BlockLocator{ highestBlock = &BlockLocator{
Number: number, Number: number,
Hash: common.HexToHash(hash), Hash: common.HexToHash(hash),
} }
...@@ -578,12 +577,12 @@ func (d *Database) GetHighestL1Block() (*L1BlockLocator, error) { ...@@ -578,12 +577,12 @@ func (d *Database) GetHighestL1Block() (*L1BlockLocator, error) {
} }
// GetHighestL2Block returns the highest known L2 block. // GetHighestL2Block returns the highest known L2 block.
func (d *Database) GetHighestL2Block() (*L2BlockLocator, error) { func (d *Database) GetHighestL2Block() (*BlockLocator, error) {
const selectHighestBlockStatement = ` const selectHighestBlockStatement = `
SELECT number, hash FROM l2_blocks ORDER BY number DESC LIMIT 1 SELECT number, hash FROM l2_blocks ORDER BY number DESC LIMIT 1
` `
var highestBlock *L2BlockLocator var highestBlock *BlockLocator
err := txn(d.db, func(tx *sql.Tx) error { err := txn(d.db, func(tx *sql.Tx) error {
row := tx.QueryRow(selectHighestBlockStatement) row := tx.QueryRow(selectHighestBlockStatement)
if row.Err() != nil { if row.Err() != nil {
...@@ -601,9 +600,9 @@ func (d *Database) GetHighestL2Block() (*L2BlockLocator, error) { ...@@ -601,9 +600,9 @@ func (d *Database) GetHighestL2Block() (*L2BlockLocator, error) {
return err return err
} }
highestBlock = &L2BlockLocator{ highestBlock = &BlockLocator{
Number: number, Number: number,
Hash: l2common.HexToHash(hash), Hash: common.HexToHash(hash),
} }
return nil return nil
......
package db package db
import l2common "github.com/ethereum-optimism/optimism/l2geth/common" import "github.com/ethereum/go-ethereum/common"
// ETHL1Token is a placeholder token for differentiating ETH transactions from // ETHL1Token is a placeholder token for differentiating ETH transactions from
// ERC20 transactions on L1. // ERC20 transactions on L1.
...@@ -13,7 +13,7 @@ var ETHL1Token = &Token{ ...@@ -13,7 +13,7 @@ var ETHL1Token = &Token{
// ETHL2Address is a placeholder address for differentiating ETH transactions // ETHL2Address is a placeholder address for differentiating ETH transactions
// from ERC20 transactions on L2. // from ERC20 transactions on L2.
var ETHL2Address = l2common.HexToAddress("0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000") var ETHL2Address = common.HexToAddress("0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000")
// ETHL2Token is a placeholder token for differentiating ETH transactions from // ETHL2Token is a placeholder token for differentiating ETH transactions from
// ERC20 transactions on L2. // ERC20 transactions on L2.
......
package db package db
import ( import (
l2common "github.com/ethereum-optimism/optimism/l2geth/common"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
) )
...@@ -21,8 +20,8 @@ func (b IndexedL1Block) String() string { ...@@ -21,8 +20,8 @@ func (b IndexedL1Block) String() string {
// IndexedL2Block contains the L2 block including the withdrawals in it. // IndexedL2Block contains the L2 block including the withdrawals in it.
type IndexedL2Block struct { type IndexedL2Block struct {
Hash l2common.Hash Hash common.Hash
ParentHash l2common.Hash ParentHash common.Hash
Number uint64 Number uint64
Timestamp uint64 Timestamp uint64
Withdrawals []Withdrawal Withdrawals []Withdrawal
......
package db package db
import ( import (
l2common "github.com/ethereum-optimism/optimism/l2geth/common"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
) )
// L1BlockLocator contains the block locator for a L1 block. // BlockLocator contains the block number and hash. It can
type L1BlockLocator struct { // uniquely identify an Ethereum block
type BlockLocator struct {
Number uint64 `json:"number"` Number uint64 `json:"number"`
Hash common.Hash `json:"hash"` Hash common.Hash `json:"hash"`
} }
// L2BlockLocator contains the block locator for a L2 block.
type L2BlockLocator struct {
Number uint64 `json:"number"`
Hash l2common.Hash `json:"hash"`
}
...@@ -3,17 +3,17 @@ package db ...@@ -3,17 +3,17 @@ package db
import ( import (
"math/big" "math/big"
l2common "github.com/ethereum-optimism/optimism/l2geth/common" "github.com/ethereum/go-ethereum/common"
) )
// Withdrawal contains transaction data for withdrawals made via the L2 to L1 bridge. // Withdrawal contains transaction data for withdrawals made via the L2 to L1 bridge.
type Withdrawal struct { type Withdrawal struct {
GUID string GUID string
TxHash l2common.Hash TxHash common.Hash
L1Token l2common.Address L1Token common.Address
L2Token l2common.Address L2Token common.Address
FromAddress l2common.Address FromAddress common.Address
ToAddress l2common.Address ToAddress common.Address
Amount *big.Int Amount *big.Int
Data []byte Data []byte
LogIndex uint LogIndex uint
......
...@@ -2,10 +2,14 @@ module github.com/ethereum-optimism/optimism/indexer ...@@ -2,10 +2,14 @@ module github.com/ethereum-optimism/optimism/indexer
go 1.17 go 1.17
replace github.com/ethereum-optimism/optimism/l2geth v0.0.0 => ../l2geth replace (
github.com/ethereum-optimism/optimism/l2geth v0.0.0 => ../l2geth
github.com/ethereum-optimism/optimism/op-bindings v0.0.0 => ../op-bindings
)
require ( require (
github.com/ethereum-optimism/optimism/l2geth v0.0.0 github.com/ethereum-optimism/optimism/l2geth v0.0.0
github.com/ethereum-optimism/optimism/op-bindings v0.0.0
github.com/ethereum/go-ethereum v1.10.17 github.com/ethereum/go-ethereum v1.10.17
github.com/getsentry/sentry-go v0.12.0 github.com/getsentry/sentry-go v0.12.0
github.com/google/uuid v1.3.0 github.com/google/uuid v1.3.0
...@@ -22,7 +26,7 @@ require ( ...@@ -22,7 +26,7 @@ require (
github.com/aristanetworks/goarista v0.0.0-20170210015632-ea17b1a17847 // indirect github.com/aristanetworks/goarista v0.0.0-20170210015632-ea17b1a17847 // indirect
github.com/beorn7/perks v1.0.1 // indirect github.com/beorn7/perks v1.0.1 // indirect
github.com/btcsuite/btcd v0.22.1 // indirect github.com/btcsuite/btcd v0.22.1 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.1.2 // indirect github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect
......
...@@ -121,8 +121,9 @@ github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13P ...@@ -121,8 +121,9 @@ github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13P
github.com/btcsuite/btcd v0.22.0-beta/go.mod h1:9n5ntfhhHQBIhUvlhDvD3Qg6fRUj4jkN0VB8L8svzOA= github.com/btcsuite/btcd v0.22.0-beta/go.mod h1:9n5ntfhhHQBIhUvlhDvD3Qg6fRUj4jkN0VB8L8svzOA=
github.com/btcsuite/btcd v0.22.1 h1:CnwP9LM/M9xuRrGSCGeMVs9iv09uMqwsVX7EeIpgV2c= github.com/btcsuite/btcd v0.22.1 h1:CnwP9LM/M9xuRrGSCGeMVs9iv09uMqwsVX7EeIpgV2c=
github.com/btcsuite/btcd v0.22.1/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= github.com/btcsuite/btcd v0.22.1/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y=
github.com/btcsuite/btcd/btcec/v2 v2.1.2 h1:YoYoC9J0jwfukodSBMzZYUVQ8PTiYg4BnOWiJVzTmLs=
github.com/btcsuite/btcd/btcec/v2 v2.1.2/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= github.com/btcsuite/btcd/btcec/v2 v2.1.2/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE=
github.com/btcsuite/btcd/btcec/v2 v2.2.0 h1:fzn1qaOt32TuLjFlkzYSsBC35Q3KUjT1SwPxiMSCF5k=
github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU=
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc=
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U=
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc=
...@@ -776,6 +777,7 @@ github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de ...@@ -776,6 +777,7 @@ github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg=
github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
...@@ -829,6 +831,7 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 ...@@ -829,6 +831,7 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
golang.org/x/exp v0.0.0-20220426173459-3bcf042a4bf5/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE=
golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
...@@ -851,6 +854,8 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB ...@@ -851,6 +854,8 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY=
golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
...@@ -904,6 +909,7 @@ golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qx ...@@ -904,6 +909,7 @@ golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qx
golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 h1:CIJ76btIcR3eFI5EgSo6k1qKw9KJexJuRLI9G7Hp5wE= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 h1:CIJ76btIcR3eFI5EgSo6k1qKw9KJexJuRLI9G7Hp5wE=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
...@@ -995,6 +1001,7 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc ...@@ -995,6 +1001,7 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
...@@ -1077,6 +1084,7 @@ golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc ...@@ -1077,6 +1084,7 @@ golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
......
...@@ -4,6 +4,7 @@ import ( ...@@ -4,6 +4,7 @@ import (
"context" "context"
"fmt" "fmt"
"math/big" "math/big"
"net"
"net/http" "net/http"
"os" "os"
"strconv" "strconv"
...@@ -11,8 +12,6 @@ import ( ...@@ -11,8 +12,6 @@ import (
"github.com/ethereum-optimism/optimism/indexer/services" "github.com/ethereum-optimism/optimism/indexer/services"
l2rpc "github.com/ethereum-optimism/optimism/l2geth/rpc"
"github.com/ethereum-optimism/optimism/indexer/metrics" "github.com/ethereum-optimism/optimism/indexer/metrics"
"github.com/ethereum-optimism/optimism/indexer/server" "github.com/ethereum-optimism/optimism/indexer/server"
"github.com/rs/cors" "github.com/rs/cors"
...@@ -20,7 +19,6 @@ import ( ...@@ -20,7 +19,6 @@ import (
database "github.com/ethereum-optimism/optimism/indexer/db" database "github.com/ethereum-optimism/optimism/indexer/db"
"github.com/ethereum-optimism/optimism/indexer/services/l1" "github.com/ethereum-optimism/optimism/indexer/services/l1"
"github.com/ethereum-optimism/optimism/indexer/services/l2" "github.com/ethereum-optimism/optimism/indexer/services/l2"
l2ethclient "github.com/ethereum-optimism/optimism/l2geth/ethclient"
"github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/rpc"
...@@ -81,7 +79,7 @@ type Indexer struct { ...@@ -81,7 +79,7 @@ type Indexer struct {
ctx context.Context ctx context.Context
cfg Config cfg Config
l1Client *ethclient.Client l1Client *ethclient.Client
l2Client *l2ethclient.Client l2Client *ethclient.Client
l1IndexingService *l1.Service l1IndexingService *l1.Service
l2IndexingService *l2.Service l2IndexingService *l2.Service
...@@ -129,12 +127,12 @@ func NewIndexer(cfg Config, gitVersion string) (*Indexer, error) { ...@@ -129,12 +127,12 @@ func NewIndexer(cfg Config, gitVersion string) (*Indexer, error) {
// Connect to L1 and L2 providers. Perform these last since they are the // Connect to L1 and L2 providers. Perform these last since they are the
// most expensive. // most expensive.
l1Client, rawl1Client, err := dialL1EthClientWithTimeout(ctx, cfg.L1EthRpc) l1Client, rawl1Client, err := dialEthClientWithTimeout(ctx, cfg.L1EthRpc)
if err != nil { if err != nil {
return nil, err return nil, err
} }
l2Client, l2RPC, err := dialL2EthClientWithTimeout(ctx, cfg.L2EthRpc) l2Client, l2RPC, err := dialEthClientWithTimeout(ctx, cfg.L2EthRpc)
if err != nil { if err != nil {
return nil, err return nil, err
} }
...@@ -234,7 +232,7 @@ func (b *Indexer) Serve() error { ...@@ -234,7 +232,7 @@ func (b *Indexer) Serve() error {
middleware := server.LoggingMiddleware(b.metrics, log.New("service", "server")) middleware := server.LoggingMiddleware(b.metrics, log.New("service", "server"))
port := strconv.FormatUint(b.cfg.RESTPort, 10) port := strconv.FormatUint(b.cfg.RESTPort, 10)
addr := fmt.Sprintf("%s:%s", b.cfg.RESTHostname, port) addr := net.JoinHostPort(b.cfg.RESTHostname, port)
log.Info("indexer REST server listening on", "addr", addr) log.Info("indexer REST server listening on", "addr", addr)
return http.ListenAndServe(addr, middleware(c.Handler(b.router))) return http.ListenAndServe(addr, middleware(c.Handler(b.router)))
...@@ -270,7 +268,7 @@ func (b *Indexer) Stop() { ...@@ -270,7 +268,7 @@ func (b *Indexer) Stop() {
// dialL1EthClientWithTimeout attempts to dial the L1 provider using the // dialL1EthClientWithTimeout attempts to dial the L1 provider using the
// provided URL. If the dial doesn't complete within defaultDialTimeout seconds, // provided URL. If the dial doesn't complete within defaultDialTimeout seconds,
// this method will return an error. // this method will return an error.
func dialL1EthClientWithTimeout(ctx context.Context, url string) ( func dialEthClientWithTimeout(ctx context.Context, url string) (
*ethclient.Client, *rpc.Client, error) { *ethclient.Client, *rpc.Client, error) {
ctxt, cancel := context.WithTimeout(ctx, defaultDialTimeout) ctxt, cancel := context.WithTimeout(ctx, defaultDialTimeout)
...@@ -283,23 +281,6 @@ func dialL1EthClientWithTimeout(ctx context.Context, url string) ( ...@@ -283,23 +281,6 @@ func dialL1EthClientWithTimeout(ctx context.Context, url string) (
return ethclient.NewClient(c), c, nil return ethclient.NewClient(c), c, nil
} }
// dialL2EthClientWithTimeout attempts to dial the L2 provider using the
// provided URL. If the dial doesn't complete within defaultDialTimeout seconds,
// this method will return an error.
func dialL2EthClientWithTimeout(ctx context.Context, url string) (
*l2ethclient.Client, *l2rpc.Client, error) {
ctxt, cancel := context.WithTimeout(ctx, defaultDialTimeout)
defer cancel()
rpc, err := l2rpc.DialContext(ctxt, url)
if err != nil {
return nil, nil, err
}
return l2ethclient.NewClient(rpc), rpc, nil
}
// traceRateToFloat64 converts a time.Duration into a valid float64 for the // traceRateToFloat64 converts a time.Duration into a valid float64 for the
// Sentry client. The client only accepts values between 0.0 and 1.0, so this // Sentry client. The client only accepts values between 0.0 and 1.0, so this
// method clamps anything greater than 1 second to 1.0. // method clamps anything greater than 1 second to 1.0.
......
package metrics package metrics
import ( import (
"fmt" "net"
"net/http" "net/http"
"strconv" "strconv"
"time" "time"
l2common "github.com/ethereum-optimism/optimism/l2geth/common"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto" "github.com/prometheus/client_golang/prometheus/promauto"
...@@ -160,7 +159,7 @@ func (m *Metrics) RecordDeposit(addr common.Address) { ...@@ -160,7 +159,7 @@ func (m *Metrics) RecordDeposit(addr common.Address) {
m.DepositsCount.WithLabelValues(sym).Inc() m.DepositsCount.WithLabelValues(sym).Inc()
} }
func (m *Metrics) RecordWithdrawal(addr l2common.Address) { func (m *Metrics) RecordWithdrawal(addr common.Address) {
sym := m.tokenAddrs[addr.String()] sym := m.tokenAddrs[addr.String()]
if sym == "" { if sym == "" {
sym = "UNKNOWN" sym = "UNKNOWN"
...@@ -218,7 +217,7 @@ func (m *Metrics) Serve(hostname string, port uint64) (*http.Server, error) { ...@@ -218,7 +217,7 @@ func (m *Metrics) Serve(hostname string, port uint64) (*http.Server, error) {
mux := http.NewServeMux() mux := http.NewServeMux()
mux.Handle("/metrics", promhttp.Handler()) mux.Handle("/metrics", promhttp.Handler())
srv := new(http.Server) srv := new(http.Server)
srv.Addr = fmt.Sprintf("%s:%d", hostname, port) srv.Addr = net.JoinHostPort(hostname, strconv.FormatUint(port, 10))
srv.Handler = mux srv.Handler = mux
err := srv.ListenAndServe() err := srv.ListenAndServe()
return srv, err return srv, err
......
...@@ -3,7 +3,8 @@ package bridge ...@@ -3,7 +3,8 @@ package bridge
import ( import (
"fmt" "fmt"
"github.com/ethereum-optimism/optimism/indexer/bindings/address_manager" "github.com/ethereum-optimism/optimism/op-bindings/bindings"
"github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
) )
...@@ -28,7 +29,7 @@ func NewAddresses(client bind.ContractBackend, addrMgrAddr common.Address) (*Add ...@@ -28,7 +29,7 @@ func NewAddresses(client bind.ContractBackend, addrMgrAddr common.Address) (*Add
} }
ret.addrs["AddressManager"] = addrMgrAddr ret.addrs["AddressManager"] = addrMgrAddr
mgr, err := address_manager.NewAddressManager(addrMgrAddr, client) mgr, err := bindings.NewLibAddressManager(addrMgrAddr, client)
if err != nil { if err != nil {
return nil, err return nil, err
} }
......
...@@ -95,8 +95,8 @@ type Service struct { ...@@ -95,8 +95,8 @@ type Service struct {
} }
type IndexerStatus struct { type IndexerStatus struct {
Synced float64 `json:"synced"` Synced float64 `json:"synced"`
Highest db.L1BlockLocator `json:"highest_block"` Highest db.BlockLocator `json:"highest_block"`
} }
func NewService(cfg ServiceConfig) (*Service, error) { func NewService(cfg ServiceConfig) (*Service, error) {
...@@ -203,7 +203,7 @@ func (s *Service) Loop(ctx context.Context) { ...@@ -203,7 +203,7 @@ func (s *Service) Loop(ctx context.Context) {
} }
func (s *Service) Update(newHeader *types.Header) error { func (s *Service) Update(newHeader *types.Header) error {
var lowest = db.L1BlockLocator{ var lowest = db.BlockLocator{
Number: s.cfg.StartBlockNumber, Number: s.cfg.StartBlockNumber,
Hash: common.HexToHash(s.cfg.StartBlockHash), Hash: common.HexToHash(s.cfg.StartBlockHash),
} }
......
...@@ -8,8 +8,8 @@ import ( ...@@ -8,8 +8,8 @@ import (
"github.com/ethereum-optimism/optimism/indexer/bindings/l2bridge" "github.com/ethereum-optimism/optimism/indexer/bindings/l2bridge"
"github.com/ethereum-optimism/optimism/indexer/db" "github.com/ethereum-optimism/optimism/indexer/db"
"github.com/ethereum-optimism/optimism/l2geth/accounts/abi/bind" "github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum-optimism/optimism/l2geth/common" "github.com/ethereum/go-ethereum/common"
) )
type WithdrawalsMap map[common.Hash][]db.Withdrawal type WithdrawalsMap map[common.Hash][]db.Withdrawal
......
...@@ -5,7 +5,7 @@ import ( ...@@ -5,7 +5,7 @@ import (
"time" "time"
"github.com/ethereum-optimism/optimism/indexer/bindings/l2bridge" "github.com/ethereum-optimism/optimism/indexer/bindings/l2bridge"
"github.com/ethereum-optimism/optimism/l2geth/accounts/abi/bind" "github.com/ethereum/go-ethereum/accounts/abi/bind"
) )
// clientRetryInterval is the interval to wait between retrying client API // clientRetryInterval is the interval to wait between retrying client API
......
...@@ -6,8 +6,8 @@ import ( ...@@ -6,8 +6,8 @@ import (
"github.com/ethereum-optimism/optimism/indexer/bindings/l2bridge" "github.com/ethereum-optimism/optimism/indexer/bindings/l2bridge"
"github.com/ethereum-optimism/optimism/indexer/db" "github.com/ethereum-optimism/optimism/indexer/db"
"github.com/ethereum-optimism/optimism/l2geth/accounts/abi/bind" "github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum-optimism/optimism/l2geth/common" "github.com/ethereum/go-ethereum/common"
) )
type StandardBridge struct { type StandardBridge struct {
......
...@@ -7,11 +7,10 @@ import ( ...@@ -7,11 +7,10 @@ import (
"time" "time"
"github.com/ethereum-optimism/optimism/indexer/services/util" "github.com/ethereum-optimism/optimism/indexer/services/util"
"github.com/ethereum-optimism/optimism/l2geth/rpc"
"github.com/ethereum-optimism/optimism/l2geth/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum-optimism/optimism/l2geth/log" "github.com/ethereum/go-ethereum/log"
l2rpc "github.com/ethereum-optimism/optimism/l2geth/rpc" "github.com/ethereum/go-ethereum/rpc"
) )
const ( const (
...@@ -29,7 +28,7 @@ type ConfirmedHeaderSelector struct { ...@@ -29,7 +28,7 @@ type ConfirmedHeaderSelector struct {
cfg HeaderSelectorConfig cfg HeaderSelectorConfig
} }
func HeadersByRange(ctx context.Context, client *l2rpc.Client, startHeight uint64, count int) ([]*types.Header, error) { func HeadersByRange(ctx context.Context, client *rpc.Client, startHeight uint64, count int) ([]*types.Header, error) {
height := startHeight height := startHeight
batchElems := make([]rpc.BatchElem, count) batchElems := make([]rpc.BatchElem, count)
for i := 0; i < count; i++ { for i := 0; i < count; i++ {
...@@ -63,7 +62,7 @@ func (f *ConfirmedHeaderSelector) NewHead( ...@@ -63,7 +62,7 @@ func (f *ConfirmedHeaderSelector) NewHead(
ctx context.Context, ctx context.Context,
lowest uint64, lowest uint64,
header *types.Header, header *types.Header,
client *l2rpc.Client, client *rpc.Client,
) ([]*types.Header, error) { ) ([]*types.Header, error) {
number := header.Number.Uint64() number := header.Number.Uint64()
......
...@@ -3,12 +3,13 @@ package l2 ...@@ -3,12 +3,13 @@ package l2
import ( import (
"github.com/ethereum-optimism/optimism/indexer/bindings/l2erc20" "github.com/ethereum-optimism/optimism/indexer/bindings/l2erc20"
"github.com/ethereum-optimism/optimism/indexer/db" "github.com/ethereum-optimism/optimism/indexer/db"
"github.com/ethereum-optimism/optimism/l2geth/accounts/abi/bind"
l2common "github.com/ethereum-optimism/optimism/l2geth/common" "github.com/ethereum/go-ethereum/accounts/abi/bind"
l2ethclient "github.com/ethereum-optimism/optimism/l2geth/ethclient" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/ethclient"
) )
func QueryERC20(address l2common.Address, client *l2ethclient.Client) (*db.Token, error) { func QueryERC20(address common.Address, client *ethclient.Client) (*db.Token, error) {
contract, err := l2erc20.NewL2ERC20(address, client) contract, err := l2erc20.NewL2ERC20(address, client)
if err != nil { if err != nil {
return nil, err return nil, err
......
...@@ -10,17 +10,18 @@ import ( ...@@ -10,17 +10,18 @@ import (
"sync" "sync"
"time" "time"
l2rpc "github.com/ethereum-optimism/optimism/l2geth/rpc"
"github.com/ethereum-optimism/optimism/indexer/metrics" "github.com/ethereum-optimism/optimism/indexer/metrics"
"github.com/ethereum-optimism/optimism/indexer/server" "github.com/ethereum-optimism/optimism/indexer/server"
"github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus"
"github.com/ethereum-optimism/optimism/indexer/db" "github.com/ethereum-optimism/optimism/indexer/db"
"github.com/ethereum-optimism/optimism/indexer/services/l2/bridge" "github.com/ethereum-optimism/optimism/indexer/services/l2/bridge"
"github.com/ethereum-optimism/optimism/l2geth/common"
"github.com/ethereum-optimism/optimism/l2geth/core/types" "github.com/ethereum/go-ethereum/rpc"
l2ethclient "github.com/ethereum-optimism/optimism/l2geth/ethclient"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/gorilla/mux" "github.com/gorilla/mux"
) )
...@@ -44,7 +45,7 @@ var clientRetryInterval = 5 * time.Second ...@@ -44,7 +45,7 @@ var clientRetryInterval = 5 * time.Second
// HeaderByNumberWithRetry retries the given func until it succeeds, waiting // HeaderByNumberWithRetry retries the given func until it succeeds, waiting
// for clientRetryInterval duration after every call. // for clientRetryInterval duration after every call.
func HeaderByNumberWithRetry(ctx context.Context, func HeaderByNumberWithRetry(ctx context.Context,
client *l2ethclient.Client) (*types.Header, error) { client *ethclient.Client) (*types.Header, error) {
for { for {
res, err := client.HeaderByNumber(ctx, nil) res, err := client.HeaderByNumber(ctx, nil)
switch err { switch err {
...@@ -60,8 +61,8 @@ func HeaderByNumberWithRetry(ctx context.Context, ...@@ -60,8 +61,8 @@ func HeaderByNumberWithRetry(ctx context.Context,
type ServiceConfig struct { type ServiceConfig struct {
Context context.Context Context context.Context
Metrics *metrics.Metrics Metrics *metrics.Metrics
L2RPC *l2rpc.Client L2RPC *rpc.Client
L2Client *l2ethclient.Client L2Client *ethclient.Client
ChainID *big.Int ChainID *big.Int
ConfDepth uint64 ConfDepth uint64
MaxHeaderBatchSize uint64 MaxHeaderBatchSize uint64
...@@ -85,8 +86,8 @@ type Service struct { ...@@ -85,8 +86,8 @@ type Service struct {
} }
type IndexerStatus struct { type IndexerStatus struct {
Synced float64 `json:"synced"` Synced float64 `json:"synced"`
Highest db.L2BlockLocator `json:"highest_block"` Highest db.BlockLocator `json:"highest_block"`
} }
func NewService(cfg ServiceConfig) (*Service, error) { func NewService(cfg ServiceConfig) (*Service, error) {
...@@ -181,7 +182,7 @@ func (s *Service) Loop(ctx context.Context) { ...@@ -181,7 +182,7 @@ func (s *Service) Loop(ctx context.Context) {
} }
func (s *Service) Update(newHeader *types.Header) error { func (s *Service) Update(newHeader *types.Header) error {
var lowest = db.L2BlockLocator{ var lowest = db.BlockLocator{
Number: s.cfg.StartBlockNumber, Number: s.cfg.StartBlockNumber,
Hash: common.HexToHash(s.cfg.StartBlockHash), Hash: common.HexToHash(s.cfg.StartBlockHash),
} }
......
...@@ -119,9 +119,9 @@ require ( ...@@ -119,9 +119,9 @@ require (
github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pkg/errors v0.9.1 // indirect github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.11.0 // indirect github.com/prometheus/client_golang v1.12.2 // indirect
github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.30.0 // indirect github.com/prometheus/common v0.35.0 // indirect
github.com/prometheus/procfs v0.7.3 // indirect github.com/prometheus/procfs v0.7.3 // indirect
github.com/prometheus/tsdb v0.10.0 // indirect github.com/prometheus/tsdb v0.10.0 // indirect
github.com/raulk/clock v1.1.0 // indirect github.com/raulk/clock v1.1.0 // indirect
...@@ -143,12 +143,12 @@ require ( ...@@ -143,12 +143,12 @@ require (
go.uber.org/multierr v1.7.0 // indirect go.uber.org/multierr v1.7.0 // indirect
go.uber.org/zap v1.19.1 // indirect go.uber.org/zap v1.19.1 // indirect
golang.org/x/crypto v0.0.0-20220307211146-efcb8507fb70 // indirect golang.org/x/crypto v0.0.0-20220307211146-efcb8507fb70 // indirect
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5 // indirect golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
google.golang.org/grpc v1.40.0 // indirect google.golang.org/grpc v1.40.0 // indirect
google.golang.org/protobuf v1.27.1 // indirect google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
gopkg.in/urfave/cli.v1 v1.20.0 // indirect gopkg.in/urfave/cli.v1 v1.20.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
......
...@@ -281,10 +281,12 @@ github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2 ...@@ -281,10 +281,12 @@ github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2
github.com/go-kit/kit v0.10.0 h1:dXFJfIHVvUcpSgDOV+Ne6t7jXri8Tfv2uOLHUZ2XNuo= github.com/go-kit/kit v0.10.0 h1:dXFJfIHVvUcpSgDOV+Ne6t7jXri8Tfv2uOLHUZ2XNuo=
github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o=
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-logfmt/logfmt v0.5.0 h1:TrB8swr/68K7m9CcGut2g3UOihhbcbiMAYiuTXdEih4=
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA=
github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8=
github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
...@@ -516,6 +518,7 @@ github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u ...@@ -516,6 +518,7 @@ github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u
github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/jsternberg/zap-logfmt v1.0.0/go.mod h1:uvPs/4X51zdkcm5jXl5SYoN+4RK21K8mysFmDaM/h+o= github.com/jsternberg/zap-logfmt v1.0.0/go.mod h1:uvPs/4X51zdkcm5jXl5SYoN+4RK21K8mysFmDaM/h+o=
...@@ -782,6 +785,7 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ ...@@ -782,6 +785,7 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8=
github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8=
github.com/mr-tron/base58 v1.1.2/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mr-tron/base58 v1.1.2/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc=
...@@ -915,8 +919,10 @@ github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeD ...@@ -915,8 +919,10 @@ github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeD
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU=
github.com/prometheus/client_golang v1.10.0/go.mod h1:WJM3cc3yu7XKBKa/I8WeZm+V3eltZnBwfENSU7mdogU= github.com/prometheus/client_golang v1.10.0/go.mod h1:WJM3cc3yu7XKBKa/I8WeZm+V3eltZnBwfENSU7mdogU=
github.com/prometheus/client_golang v1.11.0 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ=
github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0=
github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY=
github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34=
github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
...@@ -934,8 +940,10 @@ github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB8 ...@@ -934,8 +940,10 @@ github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB8
github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s=
github.com/prometheus/common v0.18.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.18.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s=
github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
github.com/prometheus/common v0.30.0 h1:JEkYlQnpzrzQFxi6gnukFPdQ+ac82oRhzMcIduJu/Ug=
github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
github.com/prometheus/common v0.35.0 h1:Eyr+Pw2VymWejHqCugNaQXkAi6KayVNxaHeu6khmFBE=
github.com/prometheus/common v0.35.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA=
github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
...@@ -1254,8 +1262,10 @@ golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qx ...@@ -1254,8 +1262,10 @@ golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qx
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 h1:CIJ76btIcR3eFI5EgSo6k1qKw9KJexJuRLI9G7Hp5wE=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc=
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
...@@ -1264,6 +1274,7 @@ golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4Iltr ...@@ -1264,6 +1274,7 @@ golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4Iltr
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
...@@ -1364,10 +1375,12 @@ golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBc ...@@ -1364,10 +1375,12 @@ golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5 h1:y/woIyUBFbpQGKS0u1aHF/40WUDnek3fPOyD08H5Vng=
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c h1:aFV+BgZ4svzjfabn8ERpuB4JI4N6/rdy1iusx77G3oU=
golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY=
...@@ -1564,8 +1577,9 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj ...@@ -1564,8 +1577,9 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ=
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
......
...@@ -2,10 +2,9 @@ SHELL := /bin/bash ...@@ -2,10 +2,9 @@ SHELL := /bin/bash
all: mkdir bindings deployed all: mkdir bindings deployed
bindings: l1block-bindings l2-to-l1-message-passer-bindings optimism-portal-bindings l2-output-oracle-bindings gas-price-oracle-bindings bindings: l1block-bindings l2-to-l1-message-passer-bindings optimism-portal-bindings l2-output-oracle-bindings gas-price-oracle-bindings address-manager-bindings
deployed: l1-block-deployed optimism-portal-deployed l2-to-l1-message-passer-deployed gas-price-oracle-deployed deployed: l1-block-deployed optimism-portal-deployed l2-to-l1-message-passer-deployed gas-price-oracle-deployed
l1-block-deployed: l1block-bindings l1-block-deployed: l1block-bindings
./gen_deployed_bytecode.sh L1Block bindings ./gen_deployed_bytecode.sh L1Block bindings
...@@ -33,6 +32,9 @@ l2-output-oracle-bindings: ...@@ -33,6 +32,9 @@ l2-output-oracle-bindings:
gas-price-oracle-bindings: gas-price-oracle-bindings:
./gen_bindings.sh GasPriceOracle bindings ./gen_bindings.sh GasPriceOracle bindings
address-manager-bindings:
./gen_bindings.sh Lib_AddressManager bindings
mkdir: mkdir:
mkdir -p bin bindings mkdir -p bin bindings
......
// 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
)
// LibAddressManagerMetaData contains all meta data concerning the LibAddressManager contract.
var LibAddressManagerMetaData = &bind.MetaData{
ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_newAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_oldAddress\",\"type\":\"address\"}],\"name\":\"AddressSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"}],\"name\":\"getAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"setAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]",
Bin: "0x608060405234801561001057600080fd5b5061001a3361001f565b61006f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6106d98061007e6000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c80639b2ea4bd116100505780639b2ea4bd146100b9578063bf40fac1146100cc578063f2fde38b146100df57600080fd5b8063715018a61461006c5780638da5cb5b14610076575b600080fd5b6100746100f2565b005b60005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6100746100c73660046105e4565b610184565b6100906100da366004610632565b6102d0565b6100746100ed36600461066f565b61030c565b60005473ffffffffffffffffffffffffffffffffffffffff163314610178576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b610182600061043c565b565b60005473ffffffffffffffffffffffffffffffffffffffff163314610205576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161016f565b6000610210836104b1565b60008181526001602052604090819020805473ffffffffffffffffffffffffffffffffffffffff8681167fffffffffffffffffffffffff000000000000000000000000000000000000000083161790925591519293501690610273908590610691565b6040805191829003822073ffffffffffffffffffffffffffffffffffffffff808716845284166020840152917f9416a153a346f93d95f94b064ae3f148b6460473c6e82b3f9fc2521b873fcd6c910160405180910390a250505050565b6000600160006102df846104b1565b815260208101919091526040016000205473ffffffffffffffffffffffffffffffffffffffff1692915050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461038d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161016f565b73ffffffffffffffffffffffffffffffffffffffff8116610430576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161016f565b6104398161043c565b50565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000816040516020016104c49190610691565b604051602081830303815290604052805190602001209050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f83011261052157600080fd5b813567ffffffffffffffff8082111561053c5761053c6104e1565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715610582576105826104e1565b8160405283815286602085880101111561059b57600080fd5b836020870160208301376000602085830101528094505050505092915050565b803573ffffffffffffffffffffffffffffffffffffffff811681146105df57600080fd5b919050565b600080604083850312156105f757600080fd5b823567ffffffffffffffff81111561060e57600080fd5b61061a85828601610510565b925050610629602084016105bb565b90509250929050565b60006020828403121561064457600080fd5b813567ffffffffffffffff81111561065b57600080fd5b61066784828501610510565b949350505050565b60006020828403121561068157600080fd5b61068a826105bb565b9392505050565b6000825160005b818110156106b25760208186018101518583015201610698565b818111156106c1576000828501525b50919091019291505056fea164736f6c634300080a000a",
}
// LibAddressManagerABI is the input ABI used to generate the binding from.
// Deprecated: Use LibAddressManagerMetaData.ABI instead.
var LibAddressManagerABI = LibAddressManagerMetaData.ABI
// LibAddressManagerBin is the compiled bytecode used for deploying new contracts.
// Deprecated: Use LibAddressManagerMetaData.Bin instead.
var LibAddressManagerBin = LibAddressManagerMetaData.Bin
// DeployLibAddressManager deploys a new Ethereum contract, binding an instance of LibAddressManager to it.
func DeployLibAddressManager(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *LibAddressManager, error) {
parsed, err := LibAddressManagerMetaData.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(LibAddressManagerBin), backend)
if err != nil {
return common.Address{}, nil, nil, err
}
return address, tx, &LibAddressManager{LibAddressManagerCaller: LibAddressManagerCaller{contract: contract}, LibAddressManagerTransactor: LibAddressManagerTransactor{contract: contract}, LibAddressManagerFilterer: LibAddressManagerFilterer{contract: contract}}, nil
}
// LibAddressManager is an auto generated Go binding around an Ethereum contract.
type LibAddressManager struct {
LibAddressManagerCaller // Read-only binding to the contract
LibAddressManagerTransactor // Write-only binding to the contract
LibAddressManagerFilterer // Log filterer for contract events
}
// LibAddressManagerCaller is an auto generated read-only Go binding around an Ethereum contract.
type LibAddressManagerCaller struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
// LibAddressManagerTransactor is an auto generated write-only Go binding around an Ethereum contract.
type LibAddressManagerTransactor struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
// LibAddressManagerFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
type LibAddressManagerFilterer struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
// LibAddressManagerSession is an auto generated Go binding around an Ethereum contract,
// with pre-set call and transact options.
type LibAddressManagerSession struct {
Contract *LibAddressManager // 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
}
// LibAddressManagerCallerSession is an auto generated read-only Go binding around an Ethereum contract,
// with pre-set call options.
type LibAddressManagerCallerSession struct {
Contract *LibAddressManagerCaller // Generic contract caller binding to set the session for
CallOpts bind.CallOpts // Call options to use throughout this session
}
// LibAddressManagerTransactorSession is an auto generated write-only Go binding around an Ethereum contract,
// with pre-set transact options.
type LibAddressManagerTransactorSession struct {
Contract *LibAddressManagerTransactor // Generic contract transactor binding to set the session for
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
}
// LibAddressManagerRaw is an auto generated low-level Go binding around an Ethereum contract.
type LibAddressManagerRaw struct {
Contract *LibAddressManager // Generic contract binding to access the raw methods on
}
// LibAddressManagerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
type LibAddressManagerCallerRaw struct {
Contract *LibAddressManagerCaller // Generic read-only contract binding to access the raw methods on
}
// LibAddressManagerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
type LibAddressManagerTransactorRaw struct {
Contract *LibAddressManagerTransactor // Generic write-only contract binding to access the raw methods on
}
// NewLibAddressManager creates a new instance of LibAddressManager, bound to a specific deployed contract.
func NewLibAddressManager(address common.Address, backend bind.ContractBackend) (*LibAddressManager, error) {
contract, err := bindLibAddressManager(address, backend, backend, backend)
if err != nil {
return nil, err
}
return &LibAddressManager{LibAddressManagerCaller: LibAddressManagerCaller{contract: contract}, LibAddressManagerTransactor: LibAddressManagerTransactor{contract: contract}, LibAddressManagerFilterer: LibAddressManagerFilterer{contract: contract}}, nil
}
// NewLibAddressManagerCaller creates a new read-only instance of LibAddressManager, bound to a specific deployed contract.
func NewLibAddressManagerCaller(address common.Address, caller bind.ContractCaller) (*LibAddressManagerCaller, error) {
contract, err := bindLibAddressManager(address, caller, nil, nil)
if err != nil {
return nil, err
}
return &LibAddressManagerCaller{contract: contract}, nil
}
// NewLibAddressManagerTransactor creates a new write-only instance of LibAddressManager, bound to a specific deployed contract.
func NewLibAddressManagerTransactor(address common.Address, transactor bind.ContractTransactor) (*LibAddressManagerTransactor, error) {
contract, err := bindLibAddressManager(address, nil, transactor, nil)
if err != nil {
return nil, err
}
return &LibAddressManagerTransactor{contract: contract}, nil
}
// NewLibAddressManagerFilterer creates a new log filterer instance of LibAddressManager, bound to a specific deployed contract.
func NewLibAddressManagerFilterer(address common.Address, filterer bind.ContractFilterer) (*LibAddressManagerFilterer, error) {
contract, err := bindLibAddressManager(address, nil, nil, filterer)
if err != nil {
return nil, err
}
return &LibAddressManagerFilterer{contract: contract}, nil
}
// bindLibAddressManager binds a generic wrapper to an already deployed contract.
func bindLibAddressManager(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
parsed, err := abi.JSON(strings.NewReader(LibAddressManagerABI))
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 (_LibAddressManager *LibAddressManagerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _LibAddressManager.Contract.LibAddressManagerCaller.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 (_LibAddressManager *LibAddressManagerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
return _LibAddressManager.Contract.LibAddressManagerTransactor.contract.Transfer(opts)
}
// Transact invokes the (paid) contract method with params as input values.
func (_LibAddressManager *LibAddressManagerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
return _LibAddressManager.Contract.LibAddressManagerTransactor.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 (_LibAddressManager *LibAddressManagerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _LibAddressManager.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 (_LibAddressManager *LibAddressManagerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
return _LibAddressManager.Contract.contract.Transfer(opts)
}
// Transact invokes the (paid) contract method with params as input values.
func (_LibAddressManager *LibAddressManagerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
return _LibAddressManager.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 (_LibAddressManager *LibAddressManagerCaller) GetAddress(opts *bind.CallOpts, _name string) (common.Address, error) {
var out []interface{}
err := _LibAddressManager.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 (_LibAddressManager *LibAddressManagerSession) GetAddress(_name string) (common.Address, error) {
return _LibAddressManager.Contract.GetAddress(&_LibAddressManager.CallOpts, _name)
}
// GetAddress is a free data retrieval call binding the contract method 0xbf40fac1.
//
// Solidity: function getAddress(string _name) view returns(address)
func (_LibAddressManager *LibAddressManagerCallerSession) GetAddress(_name string) (common.Address, error) {
return _LibAddressManager.Contract.GetAddress(&_LibAddressManager.CallOpts, _name)
}
// Owner is a free data retrieval call binding the contract method 0x8da5cb5b.
//
// Solidity: function owner() view returns(address)
func (_LibAddressManager *LibAddressManagerCaller) Owner(opts *bind.CallOpts) (common.Address, error) {
var out []interface{}
err := _LibAddressManager.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 (_LibAddressManager *LibAddressManagerSession) Owner() (common.Address, error) {
return _LibAddressManager.Contract.Owner(&_LibAddressManager.CallOpts)
}
// Owner is a free data retrieval call binding the contract method 0x8da5cb5b.
//
// Solidity: function owner() view returns(address)
func (_LibAddressManager *LibAddressManagerCallerSession) Owner() (common.Address, error) {
return _LibAddressManager.Contract.Owner(&_LibAddressManager.CallOpts)
}
// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6.
//
// Solidity: function renounceOwnership() returns()
func (_LibAddressManager *LibAddressManagerTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) {
return _LibAddressManager.contract.Transact(opts, "renounceOwnership")
}
// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6.
//
// Solidity: function renounceOwnership() returns()
func (_LibAddressManager *LibAddressManagerSession) RenounceOwnership() (*types.Transaction, error) {
return _LibAddressManager.Contract.RenounceOwnership(&_LibAddressManager.TransactOpts)
}
// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6.
//
// Solidity: function renounceOwnership() returns()
func (_LibAddressManager *LibAddressManagerTransactorSession) RenounceOwnership() (*types.Transaction, error) {
return _LibAddressManager.Contract.RenounceOwnership(&_LibAddressManager.TransactOpts)
}
// SetAddress is a paid mutator transaction binding the contract method 0x9b2ea4bd.
//
// Solidity: function setAddress(string _name, address _address) returns()
func (_LibAddressManager *LibAddressManagerTransactor) SetAddress(opts *bind.TransactOpts, _name string, _address common.Address) (*types.Transaction, error) {
return _LibAddressManager.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 (_LibAddressManager *LibAddressManagerSession) SetAddress(_name string, _address common.Address) (*types.Transaction, error) {
return _LibAddressManager.Contract.SetAddress(&_LibAddressManager.TransactOpts, _name, _address)
}
// SetAddress is a paid mutator transaction binding the contract method 0x9b2ea4bd.
//
// Solidity: function setAddress(string _name, address _address) returns()
func (_LibAddressManager *LibAddressManagerTransactorSession) SetAddress(_name string, _address common.Address) (*types.Transaction, error) {
return _LibAddressManager.Contract.SetAddress(&_LibAddressManager.TransactOpts, _name, _address)
}
// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b.
//
// Solidity: function transferOwnership(address newOwner) returns()
func (_LibAddressManager *LibAddressManagerTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) {
return _LibAddressManager.contract.Transact(opts, "transferOwnership", newOwner)
}
// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b.
//
// Solidity: function transferOwnership(address newOwner) returns()
func (_LibAddressManager *LibAddressManagerSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {
return _LibAddressManager.Contract.TransferOwnership(&_LibAddressManager.TransactOpts, newOwner)
}
// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b.
//
// Solidity: function transferOwnership(address newOwner) returns()
func (_LibAddressManager *LibAddressManagerTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) {
return _LibAddressManager.Contract.TransferOwnership(&_LibAddressManager.TransactOpts, newOwner)
}
// LibAddressManagerAddressSetIterator is returned from FilterAddressSet and is used to iterate over the raw logs and unpacked data for AddressSet events raised by the LibAddressManager contract.
type LibAddressManagerAddressSetIterator struct {
Event *LibAddressManagerAddressSet // 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 *LibAddressManagerAddressSetIterator) 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(LibAddressManagerAddressSet)
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(LibAddressManagerAddressSet)
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 *LibAddressManagerAddressSetIterator) Error() error {
return it.fail
}
// Close terminates the iteration process, releasing any pending underlying
// resources.
func (it *LibAddressManagerAddressSetIterator) Close() error {
it.sub.Unsubscribe()
return nil
}
// LibAddressManagerAddressSet represents a AddressSet event raised by the LibAddressManager contract.
type LibAddressManagerAddressSet 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 (_LibAddressManager *LibAddressManagerFilterer) FilterAddressSet(opts *bind.FilterOpts, _name []string) (*LibAddressManagerAddressSetIterator, error) {
var _nameRule []interface{}
for _, _nameItem := range _name {
_nameRule = append(_nameRule, _nameItem)
}
logs, sub, err := _LibAddressManager.contract.FilterLogs(opts, "AddressSet", _nameRule)
if err != nil {
return nil, err
}
return &LibAddressManagerAddressSetIterator{contract: _LibAddressManager.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 (_LibAddressManager *LibAddressManagerFilterer) WatchAddressSet(opts *bind.WatchOpts, sink chan<- *LibAddressManagerAddressSet, _name []string) (event.Subscription, error) {
var _nameRule []interface{}
for _, _nameItem := range _name {
_nameRule = append(_nameRule, _nameItem)
}
logs, sub, err := _LibAddressManager.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(LibAddressManagerAddressSet)
if err := _LibAddressManager.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 (_LibAddressManager *LibAddressManagerFilterer) ParseAddressSet(log types.Log) (*LibAddressManagerAddressSet, error) {
event := new(LibAddressManagerAddressSet)
if err := _LibAddressManager.contract.UnpackLog(event, "AddressSet", log); err != nil {
return nil, err
}
event.Raw = log
return event, nil
}
// LibAddressManagerOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the LibAddressManager contract.
type LibAddressManagerOwnershipTransferredIterator struct {
Event *LibAddressManagerOwnershipTransferred // 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 *LibAddressManagerOwnershipTransferredIterator) 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(LibAddressManagerOwnershipTransferred)
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(LibAddressManagerOwnershipTransferred)
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 *LibAddressManagerOwnershipTransferredIterator) Error() error {
return it.fail
}
// Close terminates the iteration process, releasing any pending underlying
// resources.
func (it *LibAddressManagerOwnershipTransferredIterator) Close() error {
it.sub.Unsubscribe()
return nil
}
// LibAddressManagerOwnershipTransferred represents a OwnershipTransferred event raised by the LibAddressManager contract.
type LibAddressManagerOwnershipTransferred 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 (_LibAddressManager *LibAddressManagerFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*LibAddressManagerOwnershipTransferredIterator, 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 := _LibAddressManager.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule)
if err != nil {
return nil, err
}
return &LibAddressManagerOwnershipTransferredIterator{contract: _LibAddressManager.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 (_LibAddressManager *LibAddressManagerFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *LibAddressManagerOwnershipTransferred, 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 := _LibAddressManager.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(LibAddressManagerOwnershipTransferred)
if err := _LibAddressManager.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 (_LibAddressManager *LibAddressManagerFilterer) ParseOwnershipTransferred(log types.Log) (*LibAddressManagerOwnershipTransferred, error) {
event := new(LibAddressManagerOwnershipTransferred)
if err := _LibAddressManager.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil {
return nil, err
}
event.Raw = log
return event, nil
}
...@@ -38,8 +38,8 @@ type WithdrawalVerifierOutputRootProof struct { ...@@ -38,8 +38,8 @@ type WithdrawalVerifierOutputRootProof struct {
// OptimismPortalMetaData contains all meta data concerning the OptimismPortal contract. // OptimismPortalMetaData contains all meta data concerning the OptimismPortal contract.
var OptimismPortalMetaData = &bind.MetaData{ var OptimismPortalMetaData = &bind.MetaData{
ABI: "[{\"inputs\":[{\"internalType\":\"contractL2OutputOracle\",\"name\":\"_l2Oracle\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_finalizationPeriodSeconds\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"mint\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"gasLimit\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"isCreation\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"TransactionDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"withdrawalHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"name\":\"WithdrawalFinalized\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BASE_FEE_MAX_CHANGE_DENOMINATOR\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ELASTICITY_MULTIPLIER\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"FINALIZATION_PERIOD_SECONDS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"INITIAL_BASE_FEE\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"L2_ORACLE\",\"outputs\":[{\"internalType\":\"contractL2OutputOracle\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_RESOURCE_LIMIT\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MINIMUM_BASE_FEE\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"TARGET_RESOURCE_LIMIT\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"_gasLimit\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"_isCreation\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"depositTransaction\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_nonce\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_l2BlockNumber\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"version\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"stateRoot\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"withdrawerStorageRoot\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"latestBlockhash\",\"type\":\"bytes32\"}],\"internalType\":\"structWithdrawalVerifier.OutputRootProof\",\"name\":\"_outputRootProof\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"_withdrawalProof\",\"type\":\"bytes\"}],\"name\":\"finalizeWithdrawalTransaction\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"finalizedWithdrawals\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l2Sender\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"params\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"prevBaseFee\",\"type\":\"uint128\"},{\"internalType\":\"uint64\",\"name\":\"prevBoughtGas\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"prevBlockNum\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", ABI: "[{\"inputs\":[{\"internalType\":\"contractL2OutputOracle\",\"name\":\"_l2Oracle\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_finalizationPeriodSeconds\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"mint\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"gasLimit\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"isCreation\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"TransactionDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"withdrawalHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"name\":\"WithdrawalFinalized\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BASE_FEE_MAX_CHANGE_DENOMINATOR\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ELASTICITY_MULTIPLIER\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"FINALIZATION_PERIOD_SECONDS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"INITIAL_BASE_FEE\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"L2_ORACLE\",\"outputs\":[{\"internalType\":\"contractL2OutputOracle\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_RESOURCE_LIMIT\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MINIMUM_BASE_FEE\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"OPTIMISM_PORTAL_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"TARGET_RESOURCE_LIMIT\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"_gasLimit\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"_isCreation\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"depositTransaction\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_nonce\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_l2BlockNumber\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"version\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"stateRoot\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"withdrawerStorageRoot\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"latestBlockhash\",\"type\":\"bytes32\"}],\"internalType\":\"structWithdrawalVerifier.OutputRootProof\",\"name\":\"_outputRootProof\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"_withdrawalProof\",\"type\":\"bytes\"}],\"name\":\"finalizeWithdrawalTransaction\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"finalizedWithdrawals\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_l2BlockNumber\",\"type\":\"uint256\"}],\"name\":\"isOutputFinalized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l2Sender\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"params\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"prevBaseFee\",\"type\":\"uint128\"},{\"internalType\":\"uint64\",\"name\":\"prevBoughtGas\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"prevBlockNum\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]",
Bin: "0x60c0604052600180546001600160a01b03191661dead1790553480156200002557600080fd5b50604051620035c6380380620035c6833981016040819052620000489162000096565b60408051606081018252633b9aca00808252600060208301819052436001600160401b031692909301829052600160c01b9091021790556001600160a01b0390911660a052608052620000d2565b60008060408385031215620000aa57600080fd5b82516001600160a01b0381168114620000c257600080fd5b6020939093015192949293505050565b60805160a0516134c0620001066000396000818161011301526109ac0152600081816103580152610a2f01526134c06000f3fe6080604052600436106100d55760003560e01c8063a14238e71161007f578063cff0ab9611610059578063cff0ab961461027f578063e9e05c4214610320578063eecf1c3614610333578063f4daa2911461034657600080fd5b8063a14238e714610215578063ca3e99ba14610255578063cd7c97891461026a57600080fd5b80636bb0291e116100b05780636bb0291e146101bd578063867ead13146101d25780639bf62d82146101e857600080fd5b80621c2ff61461010157806313620abd1461015f57806364b792081461019857600080fd5b366100fc576100fa3334620186a060006040518060200160405280600081525061037a565b005b600080fd5b34801561010d57600080fd5b506101357f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b34801561016b57600080fd5b50610177633b9aca0081565b6040516fffffffffffffffffffffffffffffffff9091168152602001610156565b3480156101a457600080fd5b506101af627a120081565b604051908152602001610156565b3480156101c957600080fd5b506101af600481565b3480156101de57600080fd5b506101af61271081565b3480156101f457600080fd5b506001546101359073ffffffffffffffffffffffffffffffffffffffff1681565b34801561022157600080fd5b50610245610230366004612bb8565b60026020526000908152604090205460ff1681565b6040519015158152602001610156565b34801561026157600080fd5b506101af61081a565b34801561027657600080fd5b506101af600881565b34801561028b57600080fd5b506000546102e7906fffffffffffffffffffffffffffffffff81169067ffffffffffffffff7001000000000000000000000000000000008204811691780100000000000000000000000000000000000000000000000090041683565b604080516fffffffffffffffffffffffffffffffff909416845267ffffffffffffffff9283166020850152911690820152606001610156565b6100fa61032e366004612c78565b61037a565b6100fa610341366004612dc2565b61082b565b34801561035257600080fd5b506101af7f000000000000000000000000000000000000000000000000000000000000000081565b8260005a905083156104315773ffffffffffffffffffffffffffffffffffffffff87161561043157604080517f08c379a00000000000000000000000000000000000000000000000000000000081526020600482015260248101919091527f4f7074696d69736d506f7274616c3a206d7573742073656e6420746f2061646460448201527f72657373283029207768656e206372656174696e67206120636f6e747261637460648201526084015b60405180910390fd5b33328114610452575033731111000000000000000000000000000000001111015b8773ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f78231ae6eb73366f912bb1d64351601fb76344c537bbab635ce14d0f376f0195348a8a8a8a6040516104b7959493929190612f2d565b60405180910390a350600080546104f4907801000000000000000000000000000000000000000000000000900467ffffffffffffffff1643612f93565b9050801561067c57600061050c6004627a1200612fd9565b6000546105379190700100000000000000000000000000000000900467ffffffffffffffff16613041565b90506000600861054b6004627a1200612fd9565b60005461056b9085906fffffffffffffffffffffffffffffffff166130b5565b6105759190612fd9565b61057f9190612fd9565b60008054919250906105ca906105b4906105ac9085906fffffffffffffffffffffffffffffffff16613171565b612710610f22565b6fffffffffffffffffffffffffffffffff610f3d565b9050600184111561063d5761063a6105b4670de0b6b3a76400006106266105f2600883612fd9565b61060490670de0b6b3a7640000613041565b61060f60018a612f93565b61062190670de0b6b3a76400006131e5565b610f4c565b61063090856130b5565b6105ac9190612fd9565b90505b6fffffffffffffffffffffffffffffffff16780100000000000000000000000000000000000000000000000067ffffffffffffffff4316021760005550505b600080548491906010906106af908490700100000000000000000000000000000000900467ffffffffffffffff16613222565b92506101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550627a12006000800160109054906101000a900467ffffffffffffffff1667ffffffffffffffff16131561078a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603c60248201527f4f7074696d69736d506f7274616c3a2063616e6e6f7420627579206d6f72652060448201527f676173207468616e20617661696c61626c6520676173206c696d6974000000006064820152608401610428565b600080546107b4906fffffffffffffffffffffffffffffffff1667ffffffffffffffff861661324e565b6fffffffffffffffffffffffffffffffff16905060006107d848633b9aca00610f7d565b6107e29083613286565b905060005a6107f19086612f93565b90508082111561080d5761080d6108088284612f93565b610f8d565b5050505050505050505050565b6108286004627a1200612fd9565b81565b60015473ffffffffffffffffffffffffffffffffffffffff1661dead146108d4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f4f7074696d69736d506f7274616c3a2063616e206f6e6c79207472696767657260448201527f206f6e65207769746864726177616c20706572207472616e73616374696f6e006064820152608401610428565b73ffffffffffffffffffffffffffffffffffffffff891630141561097a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f4f7074696d69736d506f7274616c3a20796f752063616e6e6f742073656e642060448201527f6d6573736167657320746f2074686520706f7274616c20636f6e7472616374006064820152608401610428565b6040517fa25ae557000000000000000000000000000000000000000000000000000000008152600481018590526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063a25ae557906024016040805180830381865afa158015610a07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2b919061329a565b90507f00000000000000000000000000000000000000000000000000000000000000008160200151610a5d91906132e9565b4211610aeb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4f7074696d69736d506f7274616c3a2070726f706f73616c206973206e6f742060448201527f7965742066696e616c697a6564000000000000000000000000000000000000006064820152608401610428565b610b02610afd36869003860186613301565b610fbb565b815114610b91576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4f7074696d69736d506f7274616c3a20696e76616c6964206f7574707574207260448201527f6f6f742070726f6f6600000000000000000000000000000000000000000000006064820152608401610428565b6000610bd78d8d8d8d8d8d8d8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061101792505050565b9050610c1e81866040013586868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061105692505050565b610caa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4f7074696d69736d506f7274616c3a20696e76616c696420776974686472617760448201527f616c20696e636c7573696f6e2070726f6f6600000000000000000000000000006064820152608401610428565b60008181526002602052604090205460ff1615610d49576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f4f7074696d69736d506f7274616c3a207769746864726177616c20686173206160448201527f6c7265616479206265656e2066696e616c697a656400000000000000000000006064820152608401610428565b600081815260026020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055610d8c614e208a6132e9565b5a1015610e1b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f4f7074696d69736d506f7274616c3a20696e73756666696369656e742067617360448201527f20746f2066696e616c697a65207769746864726177616c0000000000000000006064820152608401610428565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8e16179055604080516020601f8a01819004810282018101909252888152600091610ea4918e918d918f918691908f908f908190840183828082843760009201919091525061111f92505050565b50600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead17905560405190915082907fdb5c7652857aa163daadd670e116628fb42e869d8ac4251ef8971d9e5727df1b90610f0a90841515815260200190565b60405180910390a25050505050505050505050505050565b600081831215610f325781610f34565b825b90505b92915050565b6000818312610f325781610f34565b6000610f34670de0b6b3a764000083610f64866111aa565b610f6e91906130b5565b610f789190612fd9565b6113ee565b600081831015610f325781610f34565b6000805a90505b825a610fa09083612f93565b1015610fb657610faf82613367565b9150610f94565b505050565b60008160000151826020015183604001518460600151604051602001610ffa949392919093845260208401929092526040830152606082015260800190565b604051602081830303815290604052805190602001209050919050565b6000868686868686604051602001611034969594939291906133a0565b6040516020818303038152906040528051906020012090509695505050505050565b604080516020810185905260009181018290528190606001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152828252805160209182012090830181905292506111149101604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152828201909152600182527f0100000000000000000000000000000000000000000000000000000000000000602083015290858761162d565b9150505b9392505050565b6000606060008060008661ffff1667ffffffffffffffff81111561114557611145612bfa565b6040519080825280601f01601f19166020018201604052801561116f576020820181803683370190505b5090506000808751602089018b8e8ef191503d925086831115611190578692505b828152826000602083013e90999098509650505050505050565b6000808213611215576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f554e444546494e454400000000000000000000000000000000000000000000006044820152606401610428565b6000606061122284611651565b03609f8181039490941b90931c6c465772b2bbbb5f824b15207a3081018102606090811d6d0388eaa27412d5aca026815d636e018202811d6d0df99ac502031bf953eff472fdcc018202811d6d13cdffb29d51d99322bdff5f2211018202811d6d0a0f742023def783a307a986912e018202811d6d01920d8043ca89b5239253284e42018202811d6c0b7a86d7375468fac667a0a527016c29508e458543d8aa4df2abee7883018302821d6d0139601a2efabe717e604cbb4894018302821d6d02247f7a7b6594320649aa03aba1018302821d7fffffffffffffffffffffffffffffffffffffff73c0c716a594e00d54e3c4cbc9018302821d7ffffffffffffffffffffffffffffffffffffffdc7b88c420e53a9890533129f6f01830290911d7fffffffffffffffffffffffffffffffffffffff465fda27eb4d63ded474e5f832019091027ffffffffffffffff5f6af8f7b3396644f18e157960000000000000000000000000105711340daa0d5f769dba1915cef59f0815a5506027d0267a36c0c95b3975ab3ee5b203a7614a3f75373f047d803ae7b6687f2b393909302929092017d57115e47018c7177eebf7cd370a3356a1b7863008a5ae8028c72b88642840160ae1d92915050565b60007ffffffffffffffffffffffffffffffffffffffffffffffffdb731c958f34d94c1821361141f57506000919050565b680755bf798b4a1bf1e58212611491576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4558505f4f564552464c4f5700000000000000000000000000000000000000006044820152606401610428565b6503782dace9d9604e83901b059150600060606bb17217f7d1cf79abc9e3b39884821b056b80000000000000000000000001901d6bb17217f7d1cf79abc9e3b39881029093037fffffffffffffffffffffffffffffffffffffffdbf3ccf1604d263450f02a550481018102606090811d6d0277594991cfc85f6e2461837cd9018202811d7fffffffffffffffffffffffffffffffffffffe5adedaa1cb095af9e4da10e363c018202811d6db1bbb201f443cf962f1a1d3db4a5018202811d7ffffffffffffffffffffffffffffffffffffd38dc772608b0ae56cce01296c0eb018202811d6e05180bb14799ab47a8a8cb2a527d57016d02d16720577bd19bf614176fe9ea6c10fe68e7fd37d0007b713f765084018402831d9081019084017ffffffffffffffffffffffffffffffffffffffe2c69812cf03b0763fd454a8f7e010290911d6e0587f503bb6ea29d25fcb7401964500190910279d835ebba824c98fb31b83b2ca45c000000000000000000000000010574029d9dc38563c32e5c2f6dc192ee70ef65f9978af30260c3939093039290921c92915050565b60008061163986611727565b905061164781868686611759565b9695505050505050565b60008082116116bc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f554e444546494e454400000000000000000000000000000000000000000000006044820152606401610428565b5060016fffffffffffffffffffffffffffffffff821160071b82811c67ffffffffffffffff1060061b1782811c63ffffffff1060051b1782811c61ffff1060041b1782811c60ff10600390811b90911783811c600f1060021b1783811c909110821b1791821c111790565b6060818051906020012060405160200161174391815260200190565b6040516020818303038152906040529050919050565b6000806000611769878686611796565b9150915081801561178b57508051602080830191909120875191880191909120145b979650505050505050565b6000606060006117a58561188b565b905060008060006117b7848a89611986565b815192955090935091501580806117cb5750815b611831576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f50726f76696465642070726f6f6620697320696e76616c69642e0000000000006044820152606401610428565b60008161184d5760405180602001604052806000815250611879565b6118798661185c600188612f93565b8151811061186c5761186c6133f7565b6020026020010151611ea3565b919b919a509098505050505050505050565b6060600061189883611ecd565b90506000815167ffffffffffffffff8111156118b6576118b6612bfa565b6040519080825280602002602001820160405280156118fb57816020015b60408051808201909152606080825260208201528152602001906001900390816118d45790505b50905060005b825181101561197e57600061192e848381518110611921576119216133f7565b6020026020010151611f00565b9050604051806040016040528082815260200161194a83611ecd565b81525083838151811061195f5761195f6133f7565b602002602001018190525050808061197690613367565b915050611901565b509392505050565b6000606081808061199687611faa565b905060008690506000806119bd604051806040016040528060608152602001606081525090565b60005b8c51811015611e5f578c81815181106119db576119db6133f7565b6020026020010151915082846119f191906132e9565b93506119fe6001886132e9565b965083611a7c57815180516020909101208514611a77576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f496e76616c696420726f6f7420686173680000000000000000000000000000006044820152606401610428565b611b6d565b815151602011611af857815180516020909101208514611a77576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f496e76616c6964206c6172676520696e7465726e616c206861736800000000006044820152606401610428565b84611b06836000015161212d565b14611b6d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f496e76616c696420696e7465726e616c206e6f646520686173680000000000006044820152606401610428565b611b79601060016132e9565b8260200151511415611bf2578551841415611b9357611e5f565b6000868581518110611ba757611ba76133f7565b602001015160f81c60f81b60f81c9050600083602001518260ff1681518110611bd257611bd26133f7565b60200260200101519050611be581612155565b9650600194505050611e4d565b60028260200151511415611deb576000611c0b8361218b565b9050600081600081518110611c2257611c226133f7565b016020015160f81c90506000611c39600283613426565b611c44906002613448565b90506000611c55848360ff166121af565b90506000611c638b8a6121af565b90506000611c7183836121e5565b905060ff851660021480611c88575060ff85166003145b15611cde57808351148015611c9d5750808251145b15611caf57611cac818b6132e9565b99505b507f80000000000000000000000000000000000000000000000000000000000000009950611e5f945050505050565b60ff85161580611cf1575060ff85166001145b15611d635782518114611d2d57507f80000000000000000000000000000000000000000000000000000000000000009950611e5f945050505050565b611d548860200151600181518110611d4757611d476133f7565b6020026020010151612155565b9a509750611e4d945050505050565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f52656365697665642061206e6f6465207769746820616e20756e6b6e6f776e2060448201527f70726566697800000000000000000000000000000000000000000000000000006064820152608401610428565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f526563656976656420616e20756e706172736561626c65206e6f64652e0000006044820152606401610428565b80611e5781613367565b9150506119c0565b507f8000000000000000000000000000000000000000000000000000000000000000841486611e8e87866121af565b909e909d50909b509950505050505050505050565b60208101518051606091610f3791611ebd90600190612f93565b81518110611921576119216133f7565b604080518082018252600080825260209182015281518083019092528251825280830190820152606090610f3790612291565b60606000806000611f10856124c4565b919450925090506000816001811115611f2b57611f2b61346b565b14611f92576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f496e76616c696420524c502062797465732076616c75652e00000000000000006044820152606401610428565b611fa1856020015184846128cb565b95945050505050565b6060600082516002611fbc91906131e5565b67ffffffffffffffff811115611fd457611fd4612bfa565b6040519080825280601f01601f191660200182016040528015611ffe576020820181803683370190505b50905060005b8351811015612126576004848281518110612021576120216133f7565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016901c826120568360026131e5565b81518110612066576120666133f7565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060108482815181106120a9576120a96133f7565b01602001516120bb919060f81c613426565b60f81b826120ca8360026131e5565b6120d59060016132e9565b815181106120e5576120e56133f7565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508061211e81613367565b915050612004565b5092915050565b600060208251101561214157506020015190565b81806020019051810190610f37919061349a565b600060606020836000015110156121765761216f836129aa565b9050612182565b61217f83611f00565b90505b6111188161212d565b6060610f376121aa8360200151600081518110611921576119216133f7565b611faa565b6060825182106121ce5750604080516020810190915260008152610f37565b610f3483838486516121e09190612f93565b6129b5565b6000805b8084511180156121f95750808351115b801561227a5750828181518110612212576122126133f7565b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916848281518110612251576122516133f7565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016145b15610f34578061228981613367565b9150506121e9565b606060008061229f846124c4565b919350909150600190508160018111156122bb576122bb61346b565b14612322576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f496e76616c696420524c50206c6973742076616c75652e0000000000000000006044820152606401610428565b6040805160208082526104208201909252600091816020015b604080518082019091526000808252602082015281526020019060019003908161233b5790505090506000835b86518110156124b95760208210612401576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f50726f766964656420524c50206c6973742065786365656473206d6178206c6960448201527f7374206c656e6774682e000000000000000000000000000000000000000000006064820152608401610428565b60008061243e6040518060400160405280858c600001516124229190612f93565b8152602001858c6020015161243791906132e9565b90526124c4565b50915091506040518060400160405280838361245a91906132e9565b8152602001848b6020015161246f91906132e9565b815250858581518110612484576124846133f7565b602090810291909101015261249a6001856132e9565b93506124a681836132e9565b6124b090846132e9565b92505050612368565b508152949350505050565b600080600080846000015111612536576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f524c50206974656d2063616e6e6f74206265206e756c6c2e00000000000000006044820152606401610428565b6020840151805160001a607f811161255b5760006001600094509450945050506128c4565b60b781116125f1576000612570608083612f93565b9050808760000151116125df576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f496e76616c696420524c502073686f727420737472696e672e000000000000006044820152606401610428565b600195509350600092506128c4915050565b60bf811161271457600061260660b783612f93565b905080876000015111612675576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f496e76616c696420524c50206c6f6e6720737472696e67206c656e6774682e006044820152606401610428565b600183015160208290036101000a900461268f81836132e9565b8851116126f8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f496e76616c696420524c50206c6f6e6720737472696e672e00000000000000006044820152606401610428565b6127038260016132e9565b96509450600093506128c492505050565b60f781116127a957600061272960c083612f93565b905080876000015111612798576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f496e76616c696420524c502073686f7274206c6973742e0000000000000000006044820152606401610428565b6001955093508492506128c4915050565b60006127b660f783612f93565b905080876000015111612825576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f496e76616c696420524c50206c6f6e67206c697374206c656e6774682e0000006044820152606401610428565b600183015160208290036101000a900461283f81836132e9565b8851116128a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c696420524c50206c6f6e67206c6973742e000000000000000000006044820152606401610428565b6128b38260016132e9565b96509450600193506128c492505050565b9193909250565b606060008267ffffffffffffffff8111156128e8576128e8612bfa565b6040519080825280601f01601f191660200182016040528015612912576020820181803683370190505b509050805160001415612926579050611118565b600061293285876132e9565b90506020820160005b612946602087613286565b81101561297d578251825261295c6020846132e9565b92506129696020836132e9565b91508061297581613367565b91505061293b565b5060006001602087066020036101000a039050808251168119845116178252839450505050509392505050565b6060610f3782612ba2565b6060816129c381601f6132e9565b1015612a2b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f770000000000000000000000000000000000006044820152606401610428565b82612a3683826132e9565b1015612a9e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f770000000000000000000000000000000000006044820152606401610428565b612aa882846132e9565b84511015612b12576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f736c6963655f6f75744f66426f756e64730000000000000000000000000000006044820152606401610428565b606082158015612b315760405191506000825260208201604052612b99565b6040519150601f8416801560200281840101858101878315602002848b0101015b81831015612b6a578051835260209283019201612b52565b5050858452601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016604052505b50949350505050565b6060610f378260200151600084600001516128cb565b600060208284031215612bca57600080fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff81168114612bf557600080fd5b919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715612c7057612c70612bfa565b604052919050565b600080600080600060a08688031215612c9057600080fd5b612c9986612bd1565b94506020808701359450604087013567ffffffffffffffff8082168214612cbf57600080fd5b9094506060880135908115158214612cd657600080fd5b90935060808801359080821115612cec57600080fd5b818901915089601f830112612d0057600080fd5b813581811115612d1257612d12612bfa565b612d42847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601612c29565b91508082528a84828501011115612d5857600080fd5b80848401858401376000848284010152508093505050509295509295909350565b60008083601f840112612d8b57600080fd5b50813567ffffffffffffffff811115612da357600080fd5b602083019150836020828501011115612dbb57600080fd5b9250929050565b60008060008060008060008060008060006101808c8e031215612de457600080fd5b8b359a50612df460208d01612bd1565b9950612e0260408d01612bd1565b985060608c0135975060808c0135965067ffffffffffffffff60a08d01351115612e2b57600080fd5b612e3b8d60a08e01358e01612d79565b909650945060c08c0135935060808c8e037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff20011215612e7957600080fd5b60e08c01925067ffffffffffffffff6101608d01351115612e9957600080fd5b612eaa8d6101608e01358e01612d79565b81935080925050509295989b509295989b9093969950565b6000815180845260005b81811015612ee857602081850181015186830182015201612ecc565b81811115612efa576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b85815284602082015267ffffffffffffffff84166040820152821515606082015260a06080820152600061178b60a0830184612ec2565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082821015612fa557612fa5612f64565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082612fe857612fe8612faa565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83147f80000000000000000000000000000000000000000000000000000000000000008314161561303c5761303c612f64565b500590565b6000808312837f80000000000000000000000000000000000000000000000000000000000000000183128115161561307b5761307b612f64565b837f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0183138116156130af576130af612f64565b50500390565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000841360008413858304851182821616156130f6576130f6612f64565b7f8000000000000000000000000000000000000000000000000000000000000000600087128682058812818416161561313157613131612f64565b6000871292508782058712848416161561314d5761314d612f64565b8785058712818416161561316357613163612f64565b505050929093029392505050565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038413811516156131ab576131ab612f64565b827f80000000000000000000000000000000000000000000000000000000000000000384128116156131df576131df612f64565b50500190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561321d5761321d612f64565b500290565b600067ffffffffffffffff80831681851680830382111561324557613245612f64565b01949350505050565b60006fffffffffffffffffffffffffffffffff8083168185168183048111821515161561327d5761327d612f64565b02949350505050565b60008261329557613295612faa565b500490565b6000604082840312156132ac57600080fd5b6040516040810181811067ffffffffffffffff821117156132cf576132cf612bfa565b604052825181526020928301519281019290925250919050565b600082198211156132fc576132fc612f64565b500190565b60006080828403121561331357600080fd5b6040516080810181811067ffffffffffffffff8211171561333657613336612bfa565b8060405250823581526020830135602082015260408301356040820152606083013560608201528091505092915050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561339957613399612f64565b5060010190565b868152600073ffffffffffffffffffffffffffffffffffffffff808816602084015280871660408401525084606083015283608083015260c060a08301526133eb60c0830184612ec2565b98975050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060ff83168061343957613439612faa565b8060ff84160691505092915050565b600060ff821660ff84168082101561346257613462612f64565b90039392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6000602082840312156134ac57600080fd5b505191905056fea164736f6c634300080a000a", Bin: "0x60c06040523480156200001157600080fd5b5060405162003e5638038062003e56833981016040819052620000349162000276565b6200006e60408051606081018252633b9aca0080825260006020830152436001600160401b031691909201819052600160c01b0217600155565b6001600160a01b03821660a05260808190526200008a62000092565b5050620002b2565b60016000620000a18262000155565b90508015620000ba576000805461ff0019166101001790555b603380546001600160a01b03191661dead1790556200010860408051606081018252633b9aca0080825260006020830152436001600160401b031691909201819052600160c01b0217600155565b801562000151576000805461ff001916905560405160ff831681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b60008054610100900460ff1615620001ee578160ff1660011480156200018e57506200018c306200026760201b620013d91760201c565b155b620001e65760405162461bcd60e51b815260206004820152602e602482015260008051602062003e3683398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b506000919050565b60005460ff8084169116106200024d5760405162461bcd60e51b815260206004820152602e602482015260008051602062003e3683398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620001dd565b506000805460ff191660ff92909216919091179055600190565b6001600160a01b03163b151590565b600080604083850312156200028a57600080fd5b82516001600160a01b0381168114620002a257600080fd5b6020939093015192949293505050565b60805160a051613b2d6200030960003960008181610134015281816108e60152818161095d015281816109f001528181610ac20152610e630152600081816103d501528181610b740152610ee60152613b2d6000f3fe6080604052600436106100f65760003560e01c80639bf62d821161008a578063cff0ab9611610059578063cff0ab96146102fc578063e9e05c421461039d578063eecf1c36146103b0578063f4daa291146103c357600080fd5b80639bf62d8214610275578063a14238e7146102a2578063ca3e99ba146102d2578063cd7c9789146102e757600080fd5b80636bb0291e116100c65780636bb0291e146102055780636dbffb781461021a5780638129fc1c1461024a578063867ead131461025f57600080fd5b80621c2ff61461012257806313620abd1461018057806335c14a16146101b957806364b79208146101e057600080fd5b3661011d5761011b3334620186a06000604051806020016040528060008152506103f7565b005b600080fd5b34801561012e57600080fd5b506101567f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b34801561018c57600080fd5b50610198633b9aca0081565b6040516fffffffffffffffffffffffffffffffff9091168152602001610177565b3480156101c557600080fd5b506101ce600181565b60405160ff9091168152602001610177565b3480156101ec57600080fd5b506101f7627a120081565b604051908152602001610177565b34801561021157600080fd5b506101f7600481565b34801561022657600080fd5b5061023a610235366004613216565b61089d565b6040519015158152602001610177565b34801561025657600080fd5b5061011b610bab565b34801561026b57600080fd5b506101f761271081565b34801561028157600080fd5b506033546101569073ffffffffffffffffffffffffffffffffffffffff1681565b3480156102ae57600080fd5b5061023a6102bd366004613216565b60346020526000908152604090205460ff1681565b3480156102de57600080fd5b506101f7610cd1565b3480156102f357600080fd5b506101f7600881565b34801561030857600080fd5b50600154610364906fffffffffffffffffffffffffffffffff81169067ffffffffffffffff7001000000000000000000000000000000008204811691780100000000000000000000000000000000000000000000000090041683565b604080516fffffffffffffffffffffffffffffffff909416845267ffffffffffffffff9283166020850152911690820152606001610177565b61011b6103ab3660046132d1565b6103f7565b61011b6103be36600461341b565b610ce2565b3480156103cf57600080fd5b506101f77f000000000000000000000000000000000000000000000000000000000000000081565b8260005a905083156104ae5773ffffffffffffffffffffffffffffffffffffffff8716156104ae57604080517f08c379a00000000000000000000000000000000000000000000000000000000081526020600482015260248101919091527f4f7074696d69736d506f7274616c3a206d7573742073656e6420746f2061646460448201527f72657373283029207768656e206372656174696e67206120636f6e747261637460648201526084015b60405180910390fd5b333281146104cf575033731111000000000000000000000000000000001111015b8773ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f78231ae6eb73366f912bb1d64351601fb76344c537bbab635ce14d0f376f0195348a8a8a8a604051610534959493929190613586565b60405180910390a350600154600090610573907801000000000000000000000000000000000000000000000000900467ffffffffffffffff16436135ec565b905080156106fc57600061058b6004627a1200613632565b6001546105b69190700100000000000000000000000000000000900467ffffffffffffffff1661369a565b9050600060086105ca6004627a1200613632565b6001546105ea9085906fffffffffffffffffffffffffffffffff1661370e565b6105f49190613632565b6105fe9190613632565b60015490915060009061064a906106349061062c9085906fffffffffffffffffffffffffffffffff166137ca565b6127106113f5565b6fffffffffffffffffffffffffffffffff611410565b905060018411156106bd576106ba610634670de0b6b3a76400006106a6610672600883613632565b61068490670de0b6b3a764000061369a565b61068f60018a6135ec565b6106a190670de0b6b3a764000061383e565b61141f565b6106b0908561370e565b61062c9190613632565b90505b6fffffffffffffffffffffffffffffffff16780100000000000000000000000000000000000000000000000067ffffffffffffffff4316021760015550505b6001805484919060109061072f908490700100000000000000000000000000000000900467ffffffffffffffff1661387b565b92506101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550627a1200600160000160109054906101000a900467ffffffffffffffff1667ffffffffffffffff16131561080b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603c60248201527f4f7074696d69736d506f7274616c3a2063616e6e6f7420627579206d6f72652060448201527f676173207468616e20617661696c61626c6520676173206c696d69740000000060648201526084016104a5565b600154600090610837906fffffffffffffffffffffffffffffffff1667ffffffffffffffff86166138a7565b6fffffffffffffffffffffffffffffffff169050600061085b48633b9aca00611450565b61086590836138df565b905060005a61087490866135ec565b9050808211156108905761089061088b82846135ec565b611460565b5050505050505050505050565b6040517fa25ae55700000000000000000000000000000000000000000000000000000000815260048101829052600090819073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063a25ae557906024016040805180830381865afa15801561092c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095091906138f3565b8051909150610b725760007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663529933df6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ea9190613942565b905060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16634ab65d736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a59573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7d9190613942565b905084811115610a9257506000949350505050565b600082610a9f83886135ec565b610aa9919061395b565b905073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001663a25ae557610af183866135ec565b610afb908961396f565b6040518263ffffffff1660e01b8152600401610b1991815260200190565b6040805180830381865afa158015610b35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5991906138f3565b8051909450610b6e5750600095945050505050565b5050505b7f00000000000000000000000000000000000000000000000000000000000000008160200151610ba2919061396f565b42119392505050565b60016000610bb88261148e565b90508015610bed57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b603380547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead179055610c6860408051606081018252633b9aca00808252600060208301524367ffffffffffffffff169190920181905278010000000000000000000000000000000000000000000000000217600155565b8015610ccd57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16905560405160ff831681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b610cdf6004627a1200613632565b81565b60335473ffffffffffffffffffffffffffffffffffffffff1661dead14610d8b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f4f7074696d69736d506f7274616c3a2063616e206f6e6c79207472696767657260448201527f206f6e65207769746864726177616c20706572207472616e73616374696f6e0060648201526084016104a5565b73ffffffffffffffffffffffffffffffffffffffff8916301415610e31576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f4f7074696d69736d506f7274616c3a20796f752063616e6e6f742073656e642060448201527f6d6573736167657320746f2074686520706f7274616c20636f6e74726163740060648201526084016104a5565b6040517fa25ae557000000000000000000000000000000000000000000000000000000008152600481018590526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063a25ae557906024016040805180830381865afa158015610ebe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ee291906138f3565b90507f00000000000000000000000000000000000000000000000000000000000000008160200151610f14919061396f565b4211610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4f7074696d69736d506f7274616c3a2070726f706f73616c206973206e6f742060448201527f7965742066696e616c697a65640000000000000000000000000000000000000060648201526084016104a5565b610fb9610fb436869003860186613987565b611619565b815114611048576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4f7074696d69736d506f7274616c3a20696e76616c6964206f7574707574207260448201527f6f6f742070726f6f66000000000000000000000000000000000000000000000060648201526084016104a5565b600061108e8d8d8d8d8d8d8d8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061167592505050565b90506110d581866040013586868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506116b492505050565b611161576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4f7074696d69736d506f7274616c3a20696e76616c696420776974686472617760448201527f616c20696e636c7573696f6e2070726f6f66000000000000000000000000000060648201526084016104a5565b60008181526034602052604090205460ff1615611200576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f4f7074696d69736d506f7274616c3a207769746864726177616c20686173206160448201527f6c7265616479206265656e2066696e616c697a6564000000000000000000000060648201526084016104a5565b600081815260346020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055611243614e208a61396f565b5a10156112d2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f4f7074696d69736d506f7274616c3a20696e73756666696369656e742067617360448201527f20746f2066696e616c697a65207769746864726177616c00000000000000000060648201526084016104a5565b603380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8e16179055604080516020601f8a0181900481028201810190925288815260009161135b918e918d918f918691908f908f908190840183828082843760009201919091525061177d92505050565b50603380547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead17905560405190915082907fdb5c7652857aa163daadd670e116628fb42e869d8ac4251ef8971d9e5727df1b906113c190841515815260200190565b60405180910390a25050505050505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b6000818312156114055781611407565b825b90505b92915050565b60008183126114055781611407565b6000611407670de0b6b3a76400008361143786611808565b611441919061370e565b61144b9190613632565b611a4c565b6000818310156114055781611407565b6000805a90505b825a61147390836135ec565b101561148957611482826139ed565b9150611467565b505050565b60008054610100900460ff1615611545578160ff1660011480156114b15750303b155b61153d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016104a5565b506000919050565b60005460ff8084169116106115dc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016104a5565b50600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff92909216919091179055600190565b919050565b60008160000151826020015183604001518460600151604051602001611658949392919093845260208401929092526040830152606082015260800190565b604051602081830303815290604052805190602001209050919050565b600086868686868660405160200161169296959493929190613a26565b6040516020818303038152906040528051906020012090509695505050505050565b604080516020810185905260009181018290528190606001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152828252805160209182012090830181905292506117729101604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152828201909152600182527f01000000000000000000000000000000000000000000000000000000000000006020830152908587611c8b565b9150505b9392505050565b6000606060008060008661ffff1667ffffffffffffffff8111156117a3576117a3613253565b6040519080825280601f01601f1916602001820160405280156117cd576020820181803683370190505b5090506000808751602089018b8e8ef191503d9250868311156117ee578692505b828152826000602083013e90999098509650505050505050565b6000808213611873576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f554e444546494e4544000000000000000000000000000000000000000000000060448201526064016104a5565b6000606061188084611caf565b03609f8181039490941b90931c6c465772b2bbbb5f824b15207a3081018102606090811d6d0388eaa27412d5aca026815d636e018202811d6d0df99ac502031bf953eff472fdcc018202811d6d13cdffb29d51d99322bdff5f2211018202811d6d0a0f742023def783a307a986912e018202811d6d01920d8043ca89b5239253284e42018202811d6c0b7a86d7375468fac667a0a527016c29508e458543d8aa4df2abee7883018302821d6d0139601a2efabe717e604cbb4894018302821d6d02247f7a7b6594320649aa03aba1018302821d7fffffffffffffffffffffffffffffffffffffff73c0c716a594e00d54e3c4cbc9018302821d7ffffffffffffffffffffffffffffffffffffffdc7b88c420e53a9890533129f6f01830290911d7fffffffffffffffffffffffffffffffffffffff465fda27eb4d63ded474e5f832019091027ffffffffffffffff5f6af8f7b3396644f18e157960000000000000000000000000105711340daa0d5f769dba1915cef59f0815a5506027d0267a36c0c95b3975ab3ee5b203a7614a3f75373f047d803ae7b6687f2b393909302929092017d57115e47018c7177eebf7cd370a3356a1b7863008a5ae8028c72b88642840160ae1d92915050565b60007ffffffffffffffffffffffffffffffffffffffffffffffffdb731c958f34d94c18213611a7d57506000919050565b680755bf798b4a1bf1e58212611aef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4558505f4f564552464c4f57000000000000000000000000000000000000000060448201526064016104a5565b6503782dace9d9604e83901b059150600060606bb17217f7d1cf79abc9e3b39884821b056b80000000000000000000000001901d6bb17217f7d1cf79abc9e3b39881029093037fffffffffffffffffffffffffffffffffffffffdbf3ccf1604d263450f02a550481018102606090811d6d0277594991cfc85f6e2461837cd9018202811d7fffffffffffffffffffffffffffffffffffffe5adedaa1cb095af9e4da10e363c018202811d6db1bbb201f443cf962f1a1d3db4a5018202811d7ffffffffffffffffffffffffffffffffffffd38dc772608b0ae56cce01296c0eb018202811d6e05180bb14799ab47a8a8cb2a527d57016d02d16720577bd19bf614176fe9ea6c10fe68e7fd37d0007b713f765084018402831d9081019084017ffffffffffffffffffffffffffffffffffffffe2c69812cf03b0763fd454a8f7e010290911d6e0587f503bb6ea29d25fcb7401964500190910279d835ebba824c98fb31b83b2ca45c000000000000000000000000010574029d9dc38563c32e5c2f6dc192ee70ef65f9978af30260c3939093039290921c92915050565b600080611c9786611d85565b9050611ca581868686611db7565b9695505050505050565b6000808211611d1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f554e444546494e4544000000000000000000000000000000000000000000000060448201526064016104a5565b5060016fffffffffffffffffffffffffffffffff821160071b82811c67ffffffffffffffff1060061b1782811c63ffffffff1060051b1782811c61ffff1060041b1782811c60ff10600390811b90911783811c600f1060021b1783811c909110821b1791821c111790565b60608180519060200120604051602001611da191815260200190565b6040516020818303038152906040529050919050565b6000806000611dc7878686611df4565b91509150818015611de957508051602080830191909120875191880191909120145b979650505050505050565b600060606000611e0385611ee9565b90506000806000611e15848a89611fe4565b81519295509093509150158080611e295750815b611e8f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f50726f76696465642070726f6f6620697320696e76616c69642e00000000000060448201526064016104a5565b600081611eab5760405180602001604052806000815250611ed7565b611ed786611eba6001886135ec565b81518110611eca57611eca613a7d565b6020026020010151612501565b919b919a509098505050505050505050565b60606000611ef68361252b565b90506000815167ffffffffffffffff811115611f1457611f14613253565b604051908082528060200260200182016040528015611f5957816020015b6040805180820190915260608082526020820152815260200190600190039081611f325790505b50905060005b8251811015611fdc576000611f8c848381518110611f7f57611f7f613a7d565b602002602001015161255e565b90506040518060400160405280828152602001611fa88361252b565b815250838381518110611fbd57611fbd613a7d565b6020026020010181905250508080611fd4906139ed565b915050611f5f565b509392505050565b60006060818080611ff487612608565b9050600086905060008061201b604051806040016040528060608152602001606081525090565b60005b8c518110156124bd578c818151811061203957612039613a7d565b60200260200101519150828461204f919061396f565b935061205c60018861396f565b9650836120da578151805160209091012085146120d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f496e76616c696420726f6f74206861736800000000000000000000000000000060448201526064016104a5565b6121cb565b815151602011612156578151805160209091012085146120d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f496e76616c6964206c6172676520696e7465726e616c2068617368000000000060448201526064016104a5565b84612164836000015161278b565b146121cb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f496e76616c696420696e7465726e616c206e6f6465206861736800000000000060448201526064016104a5565b6121d76010600161396f565b82602001515114156122505785518414156121f1576124bd565b600086858151811061220557612205613a7d565b602001015160f81c60f81b60f81c9050600083602001518260ff168151811061223057612230613a7d565b60200260200101519050612243816127b3565b96506001945050506124ab565b60028260200151511415612449576000612269836127e9565b905060008160008151811061228057612280613a7d565b016020015160f81c90506000612297600283613aac565b6122a2906002613ace565b905060006122b3848360ff1661280d565b905060006122c18b8a61280d565b905060006122cf8383612843565b905060ff8516600214806122e6575060ff85166003145b1561233c578083511480156122fb5750808251145b1561230d5761230a818b61396f565b99505b507f800000000000000000000000000000000000000000000000000000000000000099506124bd945050505050565b60ff8516158061234f575060ff85166001145b156123c1578251811461238b57507f800000000000000000000000000000000000000000000000000000000000000099506124bd945050505050565b6123b288602001516001815181106123a5576123a5613a7d565b60200260200101516127b3565b9a5097506124ab945050505050565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f52656365697665642061206e6f6465207769746820616e20756e6b6e6f776e2060448201527f707265666978000000000000000000000000000000000000000000000000000060648201526084016104a5565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f526563656976656420616e20756e706172736561626c65206e6f64652e00000060448201526064016104a5565b806124b5816139ed565b91505061201e565b507f80000000000000000000000000000000000000000000000000000000000000008414866124ec878661280d565b909e909d50909b509950505050505050505050565b6020810151805160609161140a9161251b906001906135ec565b81518110611f7f57611f7f613a7d565b60408051808201825260008082526020918201528151808301909252825182528083019082015260609061140a906128ef565b6060600080600061256e85612b22565b91945092509050600081600181111561258957612589613af1565b146125f0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f496e76616c696420524c502062797465732076616c75652e000000000000000060448201526064016104a5565b6125ff85602001518484612f29565b95945050505050565b606060008251600261261a919061383e565b67ffffffffffffffff81111561263257612632613253565b6040519080825280601f01601f19166020018201604052801561265c576020820181803683370190505b50905060005b835181101561278457600484828151811061267f5761267f613a7d565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016901c826126b483600261383e565b815181106126c4576126c4613a7d565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350601084828151811061270757612707613a7d565b0160200151612719919060f81c613aac565b60f81b8261272883600261383e565b61273390600161396f565b8151811061274357612743613a7d565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508061277c816139ed565b915050612662565b5092915050565b600060208251101561279f57506020015190565b8180602001905181019061140a9190613942565b600060606020836000015110156127d4576127cd83613008565b90506127e0565b6127dd8361255e565b90505b6117768161278b565b606061140a6128088360200151600081518110611f7f57611f7f613a7d565b612608565b60608251821061282c575060408051602081019091526000815261140a565b611407838384865161283e91906135ec565b613013565b6000805b8084511180156128575750808351115b80156128d8575082818151811061287057612870613a7d565b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168482815181106128af576128af613a7d565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016145b1561140757806128e7816139ed565b915050612847565b60606000806128fd84612b22565b9193509091506001905081600181111561291957612919613af1565b14612980576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f496e76616c696420524c50206c6973742076616c75652e00000000000000000060448201526064016104a5565b6040805160208082526104208201909252600091816020015b60408051808201909152600080825260208201528152602001906001900390816129995790505090506000835b8651811015612b175760208210612a5f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f50726f766964656420524c50206c6973742065786365656473206d6178206c6960448201527f7374206c656e6774682e0000000000000000000000000000000000000000000060648201526084016104a5565b600080612a9c6040518060400160405280858c60000151612a8091906135ec565b8152602001858c60200151612a95919061396f565b9052612b22565b509150915060405180604001604052808383612ab8919061396f565b8152602001848b60200151612acd919061396f565b815250858581518110612ae257612ae2613a7d565b6020908102919091010152612af860018561396f565b9350612b04818361396f565b612b0e908461396f565b925050506129c6565b508152949350505050565b600080600080846000015111612b94576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f524c50206974656d2063616e6e6f74206265206e756c6c2e000000000000000060448201526064016104a5565b6020840151805160001a607f8111612bb9576000600160009450945094505050612f22565b60b78111612c4f576000612bce6080836135ec565b905080876000015111612c3d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f496e76616c696420524c502073686f727420737472696e672e0000000000000060448201526064016104a5565b60019550935060009250612f22915050565b60bf8111612d72576000612c6460b7836135ec565b905080876000015111612cd3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f496e76616c696420524c50206c6f6e6720737472696e67206c656e6774682e0060448201526064016104a5565b600183015160208290036101000a9004612ced818361396f565b885111612d56576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f496e76616c696420524c50206c6f6e6720737472696e672e000000000000000060448201526064016104a5565b612d6182600161396f565b9650945060009350612f2292505050565b60f78111612e07576000612d8760c0836135ec565b905080876000015111612df6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f496e76616c696420524c502073686f7274206c6973742e00000000000000000060448201526064016104a5565b600195509350849250612f22915050565b6000612e1460f7836135ec565b905080876000015111612e83576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f496e76616c696420524c50206c6f6e67206c697374206c656e6774682e00000060448201526064016104a5565b600183015160208290036101000a9004612e9d818361396f565b885111612f06576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c696420524c50206c6f6e67206c6973742e0000000000000000000060448201526064016104a5565b612f1182600161396f565b9650945060019350612f2292505050565b9193909250565b606060008267ffffffffffffffff811115612f4657612f46613253565b6040519080825280601f01601f191660200182016040528015612f70576020820181803683370190505b509050805160001415612f84579050611776565b6000612f90858761396f565b90506020820160005b612fa46020876138df565b811015612fdb5782518252612fba60208461396f565b9250612fc760208361396f565b915080612fd3816139ed565b915050612f99565b5060006001602087066020036101000a039050808251168119845116178252839450505050509392505050565b606061140a82613200565b60608161302181601f61396f565b1015613089576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f7700000000000000000000000000000000000060448201526064016104a5565b82613094838261396f565b10156130fc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f7700000000000000000000000000000000000060448201526064016104a5565b613106828461396f565b84511015613170576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f736c6963655f6f75744f66426f756e647300000000000000000000000000000060448201526064016104a5565b60608215801561318f57604051915060008252602082016040526131f7565b6040519150601f8416801560200281840101858101878315602002848b0101015b818310156131c85780518352602092830192016131b0565b5050858452601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016604052505b50949350505050565b606061140a826020015160008460000151612f29565b60006020828403121561322857600080fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461161457600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156132c9576132c9613253565b604052919050565b600080600080600060a086880312156132e957600080fd5b6132f28661322f565b94506020808701359450604087013567ffffffffffffffff808216821461331857600080fd5b909450606088013590811515821461332f57600080fd5b9093506080880135908082111561334557600080fd5b818901915089601f83011261335957600080fd5b81358181111561336b5761336b613253565b61339b847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601613282565b91508082528a848285010111156133b157600080fd5b80848401858401376000848284010152508093505050509295509295909350565b60008083601f8401126133e457600080fd5b50813567ffffffffffffffff8111156133fc57600080fd5b60208301915083602082850101111561341457600080fd5b9250929050565b60008060008060008060008060008060006101808c8e03121561343d57600080fd5b8b359a5061344d60208d0161322f565b995061345b60408d0161322f565b985060608c0135975060808c0135965067ffffffffffffffff60a08d0135111561348457600080fd5b6134948d60a08e01358e016133d2565b909650945060c08c0135935060808c8e037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff200112156134d257600080fd5b60e08c01925067ffffffffffffffff6101608d013511156134f257600080fd5b6135038d6101608e01358e016133d2565b81935080925050509295989b509295989b9093969950565b6000815180845260005b8181101561354157602081850181015186830182015201613525565b81811115613553576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b85815284602082015267ffffffffffffffff84166040820152821515606082015260a060808201526000611de960a083018461351b565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000828210156135fe576135fe6135bd565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261364157613641613603565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83147f800000000000000000000000000000000000000000000000000000000000000083141615613695576136956135bd565b500590565b6000808312837f8000000000000000000000000000000000000000000000000000000000000000018312811516156136d4576136d46135bd565b837f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018313811615613708576137086135bd565b50500390565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60008413600084138583048511828216161561374f5761374f6135bd565b7f8000000000000000000000000000000000000000000000000000000000000000600087128682058812818416161561378a5761378a6135bd565b600087129250878205871284841616156137a6576137a66135bd565b878505871281841616156137bc576137bc6135bd565b505050929093029392505050565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03841381151615613804576138046135bd565b827f8000000000000000000000000000000000000000000000000000000000000000038412811615613838576138386135bd565b50500190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613876576138766135bd565b500290565b600067ffffffffffffffff80831681851680830382111561389e5761389e6135bd565b01949350505050565b60006fffffffffffffffffffffffffffffffff808316818516818304811182151516156138d6576138d66135bd565b02949350505050565b6000826138ee576138ee613603565b500490565b60006040828403121561390557600080fd5b6040516040810181811067ffffffffffffffff8211171561392857613928613253565b604052825181526020928301519281019290925250919050565b60006020828403121561395457600080fd5b5051919050565b60008261396a5761396a613603565b500690565b60008219821115613982576139826135bd565b500190565b60006080828403121561399957600080fd5b6040516080810181811067ffffffffffffffff821117156139bc576139bc613253565b8060405250823581526020830135602082015260408301356040820152606083013560608201528091505092915050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a1f57613a1f6135bd565b5060010190565b868152600073ffffffffffffffffffffffffffffffffffffffff808816602084015280871660408401525084606083015283608083015260c060a0830152613a7160c083018461351b565b98975050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060ff831680613abf57613abf613603565b8060ff84160691505092915050565b600060ff821660ff841680821015613ae857613ae86135bd565b90039392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea164736f6c634300080a000a496e697469616c697a61626c653a20636f6e747261637420697320616c726561",
} }
// OptimismPortalABI is the input ABI used to generate the binding from. // OptimismPortalABI is the input ABI used to generate the binding from.
...@@ -426,6 +426,37 @@ func (_OptimismPortal *OptimismPortalCallerSession) MINIMUMBASEFEE() (*big.Int, ...@@ -426,6 +426,37 @@ func (_OptimismPortal *OptimismPortalCallerSession) MINIMUMBASEFEE() (*big.Int,
return _OptimismPortal.Contract.MINIMUMBASEFEE(&_OptimismPortal.CallOpts) return _OptimismPortal.Contract.MINIMUMBASEFEE(&_OptimismPortal.CallOpts)
} }
// OPTIMISMPORTALVERSION is a free data retrieval call binding the contract method 0x35c14a16.
//
// Solidity: function OPTIMISM_PORTAL_VERSION() view returns(uint8)
func (_OptimismPortal *OptimismPortalCaller) OPTIMISMPORTALVERSION(opts *bind.CallOpts) (uint8, error) {
var out []interface{}
err := _OptimismPortal.contract.Call(opts, &out, "OPTIMISM_PORTAL_VERSION")
if err != nil {
return *new(uint8), err
}
out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8)
return out0, err
}
// OPTIMISMPORTALVERSION is a free data retrieval call binding the contract method 0x35c14a16.
//
// Solidity: function OPTIMISM_PORTAL_VERSION() view returns(uint8)
func (_OptimismPortal *OptimismPortalSession) OPTIMISMPORTALVERSION() (uint8, error) {
return _OptimismPortal.Contract.OPTIMISMPORTALVERSION(&_OptimismPortal.CallOpts)
}
// OPTIMISMPORTALVERSION is a free data retrieval call binding the contract method 0x35c14a16.
//
// Solidity: function OPTIMISM_PORTAL_VERSION() view returns(uint8)
func (_OptimismPortal *OptimismPortalCallerSession) OPTIMISMPORTALVERSION() (uint8, error) {
return _OptimismPortal.Contract.OPTIMISMPORTALVERSION(&_OptimismPortal.CallOpts)
}
// TARGETRESOURCELIMIT is a free data retrieval call binding the contract method 0xca3e99ba. // TARGETRESOURCELIMIT is a free data retrieval call binding the contract method 0xca3e99ba.
// //
// Solidity: function TARGET_RESOURCE_LIMIT() view returns(int256) // Solidity: function TARGET_RESOURCE_LIMIT() view returns(int256)
...@@ -488,6 +519,37 @@ func (_OptimismPortal *OptimismPortalCallerSession) FinalizedWithdrawals(arg0 [3 ...@@ -488,6 +519,37 @@ func (_OptimismPortal *OptimismPortalCallerSession) FinalizedWithdrawals(arg0 [3
return _OptimismPortal.Contract.FinalizedWithdrawals(&_OptimismPortal.CallOpts, arg0) return _OptimismPortal.Contract.FinalizedWithdrawals(&_OptimismPortal.CallOpts, arg0)
} }
// IsOutputFinalized is a free data retrieval call binding the contract method 0x6dbffb78.
//
// Solidity: function isOutputFinalized(uint256 _l2BlockNumber) view returns(bool)
func (_OptimismPortal *OptimismPortalCaller) IsOutputFinalized(opts *bind.CallOpts, _l2BlockNumber *big.Int) (bool, error) {
var out []interface{}
err := _OptimismPortal.contract.Call(opts, &out, "isOutputFinalized", _l2BlockNumber)
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 _l2BlockNumber) view returns(bool)
func (_OptimismPortal *OptimismPortalSession) IsOutputFinalized(_l2BlockNumber *big.Int) (bool, error) {
return _OptimismPortal.Contract.IsOutputFinalized(&_OptimismPortal.CallOpts, _l2BlockNumber)
}
// IsOutputFinalized is a free data retrieval call binding the contract method 0x6dbffb78.
//
// Solidity: function isOutputFinalized(uint256 _l2BlockNumber) view returns(bool)
func (_OptimismPortal *OptimismPortalCallerSession) IsOutputFinalized(_l2BlockNumber *big.Int) (bool, error) {
return _OptimismPortal.Contract.IsOutputFinalized(&_OptimismPortal.CallOpts, _l2BlockNumber)
}
// L2Sender is a free data retrieval call binding the contract method 0x9bf62d82. // L2Sender is a free data retrieval call binding the contract method 0x9bf62d82.
// //
// Solidity: function l2Sender() view returns(address) // Solidity: function l2Sender() view returns(address)
...@@ -611,6 +673,27 @@ func (_OptimismPortal *OptimismPortalTransactorSession) FinalizeWithdrawalTransa ...@@ -611,6 +673,27 @@ func (_OptimismPortal *OptimismPortalTransactorSession) FinalizeWithdrawalTransa
return _OptimismPortal.Contract.FinalizeWithdrawalTransaction(&_OptimismPortal.TransactOpts, _nonce, _sender, _target, _value, _gasLimit, _data, _l2BlockNumber, _outputRootProof, _withdrawalProof) return _OptimismPortal.Contract.FinalizeWithdrawalTransaction(&_OptimismPortal.TransactOpts, _nonce, _sender, _target, _value, _gasLimit, _data, _l2BlockNumber, _outputRootProof, _withdrawalProof)
} }
// Initialize is a paid mutator transaction binding the contract method 0x8129fc1c.
//
// Solidity: function initialize() returns()
func (_OptimismPortal *OptimismPortalTransactor) Initialize(opts *bind.TransactOpts) (*types.Transaction, error) {
return _OptimismPortal.contract.Transact(opts, "initialize")
}
// Initialize is a paid mutator transaction binding the contract method 0x8129fc1c.
//
// Solidity: function initialize() returns()
func (_OptimismPortal *OptimismPortalSession) Initialize() (*types.Transaction, error) {
return _OptimismPortal.Contract.Initialize(&_OptimismPortal.TransactOpts)
}
// Initialize is a paid mutator transaction binding the contract method 0x8129fc1c.
//
// Solidity: function initialize() returns()
func (_OptimismPortal *OptimismPortalTransactorSession) Initialize() (*types.Transaction, error) {
return _OptimismPortal.Contract.Initialize(&_OptimismPortal.TransactOpts)
}
// Receive is a paid mutator transaction binding the contract receive function. // Receive is a paid mutator transaction binding the contract receive function.
// //
// Solidity: receive() payable returns() // Solidity: receive() payable returns()
...@@ -632,6 +715,140 @@ func (_OptimismPortal *OptimismPortalTransactorSession) Receive() (*types.Transa ...@@ -632,6 +715,140 @@ func (_OptimismPortal *OptimismPortalTransactorSession) Receive() (*types.Transa
return _OptimismPortal.Contract.Receive(&_OptimismPortal.TransactOpts) 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. // 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 { type OptimismPortalTransactionDepositedIterator struct {
Event *OptimismPortalTransactionDeposited // Event containing the contract specifics and raw log Event *OptimismPortalTransactionDeposited // Event containing the contract specifics and raw log
......
...@@ -2,4 +2,4 @@ ...@@ -2,4 +2,4 @@
// This file is a generated binding and any manual changes will be lost. // This file is a generated binding and any manual changes will be lost.
package bindings package bindings
var OptimismPortalDeployedBin = "0x6080604052600436106100d55760003560e01c8063a14238e71161007f578063cff0ab9611610059578063cff0ab961461027f578063e9e05c4214610320578063eecf1c3614610333578063f4daa2911461034657600080fd5b8063a14238e714610215578063ca3e99ba14610255578063cd7c97891461026a57600080fd5b80636bb0291e116100b05780636bb0291e146101bd578063867ead13146101d25780639bf62d82146101e857600080fd5b80621c2ff61461010157806313620abd1461015f57806364b792081461019857600080fd5b366100fc576100fa3334620186a060006040518060200160405280600081525061037a565b005b600080fd5b34801561010d57600080fd5b506101357f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b34801561016b57600080fd5b50610177633b9aca0081565b6040516fffffffffffffffffffffffffffffffff9091168152602001610156565b3480156101a457600080fd5b506101af627a120081565b604051908152602001610156565b3480156101c957600080fd5b506101af600481565b3480156101de57600080fd5b506101af61271081565b3480156101f457600080fd5b506001546101359073ffffffffffffffffffffffffffffffffffffffff1681565b34801561022157600080fd5b50610245610230366004612bb8565b60026020526000908152604090205460ff1681565b6040519015158152602001610156565b34801561026157600080fd5b506101af61081a565b34801561027657600080fd5b506101af600881565b34801561028b57600080fd5b506000546102e7906fffffffffffffffffffffffffffffffff81169067ffffffffffffffff7001000000000000000000000000000000008204811691780100000000000000000000000000000000000000000000000090041683565b604080516fffffffffffffffffffffffffffffffff909416845267ffffffffffffffff9283166020850152911690820152606001610156565b6100fa61032e366004612c78565b61037a565b6100fa610341366004612dc2565b61082b565b34801561035257600080fd5b506101af7f000000000000000000000000000000000000000000000000000000000000000081565b8260005a905083156104315773ffffffffffffffffffffffffffffffffffffffff87161561043157604080517f08c379a00000000000000000000000000000000000000000000000000000000081526020600482015260248101919091527f4f7074696d69736d506f7274616c3a206d7573742073656e6420746f2061646460448201527f72657373283029207768656e206372656174696e67206120636f6e747261637460648201526084015b60405180910390fd5b33328114610452575033731111000000000000000000000000000000001111015b8773ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f78231ae6eb73366f912bb1d64351601fb76344c537bbab635ce14d0f376f0195348a8a8a8a6040516104b7959493929190612f2d565b60405180910390a350600080546104f4907801000000000000000000000000000000000000000000000000900467ffffffffffffffff1643612f93565b9050801561067c57600061050c6004627a1200612fd9565b6000546105379190700100000000000000000000000000000000900467ffffffffffffffff16613041565b90506000600861054b6004627a1200612fd9565b60005461056b9085906fffffffffffffffffffffffffffffffff166130b5565b6105759190612fd9565b61057f9190612fd9565b60008054919250906105ca906105b4906105ac9085906fffffffffffffffffffffffffffffffff16613171565b612710610f22565b6fffffffffffffffffffffffffffffffff610f3d565b9050600184111561063d5761063a6105b4670de0b6b3a76400006106266105f2600883612fd9565b61060490670de0b6b3a7640000613041565b61060f60018a612f93565b61062190670de0b6b3a76400006131e5565b610f4c565b61063090856130b5565b6105ac9190612fd9565b90505b6fffffffffffffffffffffffffffffffff16780100000000000000000000000000000000000000000000000067ffffffffffffffff4316021760005550505b600080548491906010906106af908490700100000000000000000000000000000000900467ffffffffffffffff16613222565b92506101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550627a12006000800160109054906101000a900467ffffffffffffffff1667ffffffffffffffff16131561078a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603c60248201527f4f7074696d69736d506f7274616c3a2063616e6e6f7420627579206d6f72652060448201527f676173207468616e20617661696c61626c6520676173206c696d6974000000006064820152608401610428565b600080546107b4906fffffffffffffffffffffffffffffffff1667ffffffffffffffff861661324e565b6fffffffffffffffffffffffffffffffff16905060006107d848633b9aca00610f7d565b6107e29083613286565b905060005a6107f19086612f93565b90508082111561080d5761080d6108088284612f93565b610f8d565b5050505050505050505050565b6108286004627a1200612fd9565b81565b60015473ffffffffffffffffffffffffffffffffffffffff1661dead146108d4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f4f7074696d69736d506f7274616c3a2063616e206f6e6c79207472696767657260448201527f206f6e65207769746864726177616c20706572207472616e73616374696f6e006064820152608401610428565b73ffffffffffffffffffffffffffffffffffffffff891630141561097a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f4f7074696d69736d506f7274616c3a20796f752063616e6e6f742073656e642060448201527f6d6573736167657320746f2074686520706f7274616c20636f6e7472616374006064820152608401610428565b6040517fa25ae557000000000000000000000000000000000000000000000000000000008152600481018590526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063a25ae557906024016040805180830381865afa158015610a07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2b919061329a565b90507f00000000000000000000000000000000000000000000000000000000000000008160200151610a5d91906132e9565b4211610aeb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4f7074696d69736d506f7274616c3a2070726f706f73616c206973206e6f742060448201527f7965742066696e616c697a6564000000000000000000000000000000000000006064820152608401610428565b610b02610afd36869003860186613301565b610fbb565b815114610b91576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4f7074696d69736d506f7274616c3a20696e76616c6964206f7574707574207260448201527f6f6f742070726f6f6600000000000000000000000000000000000000000000006064820152608401610428565b6000610bd78d8d8d8d8d8d8d8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061101792505050565b9050610c1e81866040013586868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061105692505050565b610caa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4f7074696d69736d506f7274616c3a20696e76616c696420776974686472617760448201527f616c20696e636c7573696f6e2070726f6f6600000000000000000000000000006064820152608401610428565b60008181526002602052604090205460ff1615610d49576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f4f7074696d69736d506f7274616c3a207769746864726177616c20686173206160448201527f6c7265616479206265656e2066696e616c697a656400000000000000000000006064820152608401610428565b600081815260026020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055610d8c614e208a6132e9565b5a1015610e1b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f4f7074696d69736d506f7274616c3a20696e73756666696369656e742067617360448201527f20746f2066696e616c697a65207769746864726177616c0000000000000000006064820152608401610428565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8e16179055604080516020601f8a01819004810282018101909252888152600091610ea4918e918d918f918691908f908f908190840183828082843760009201919091525061111f92505050565b50600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead17905560405190915082907fdb5c7652857aa163daadd670e116628fb42e869d8ac4251ef8971d9e5727df1b90610f0a90841515815260200190565b60405180910390a25050505050505050505050505050565b600081831215610f325781610f34565b825b90505b92915050565b6000818312610f325781610f34565b6000610f34670de0b6b3a764000083610f64866111aa565b610f6e91906130b5565b610f789190612fd9565b6113ee565b600081831015610f325781610f34565b6000805a90505b825a610fa09083612f93565b1015610fb657610faf82613367565b9150610f94565b505050565b60008160000151826020015183604001518460600151604051602001610ffa949392919093845260208401929092526040830152606082015260800190565b604051602081830303815290604052805190602001209050919050565b6000868686868686604051602001611034969594939291906133a0565b6040516020818303038152906040528051906020012090509695505050505050565b604080516020810185905260009181018290528190606001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152828252805160209182012090830181905292506111149101604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152828201909152600182527f0100000000000000000000000000000000000000000000000000000000000000602083015290858761162d565b9150505b9392505050565b6000606060008060008661ffff1667ffffffffffffffff81111561114557611145612bfa565b6040519080825280601f01601f19166020018201604052801561116f576020820181803683370190505b5090506000808751602089018b8e8ef191503d925086831115611190578692505b828152826000602083013e90999098509650505050505050565b6000808213611215576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f554e444546494e454400000000000000000000000000000000000000000000006044820152606401610428565b6000606061122284611651565b03609f8181039490941b90931c6c465772b2bbbb5f824b15207a3081018102606090811d6d0388eaa27412d5aca026815d636e018202811d6d0df99ac502031bf953eff472fdcc018202811d6d13cdffb29d51d99322bdff5f2211018202811d6d0a0f742023def783a307a986912e018202811d6d01920d8043ca89b5239253284e42018202811d6c0b7a86d7375468fac667a0a527016c29508e458543d8aa4df2abee7883018302821d6d0139601a2efabe717e604cbb4894018302821d6d02247f7a7b6594320649aa03aba1018302821d7fffffffffffffffffffffffffffffffffffffff73c0c716a594e00d54e3c4cbc9018302821d7ffffffffffffffffffffffffffffffffffffffdc7b88c420e53a9890533129f6f01830290911d7fffffffffffffffffffffffffffffffffffffff465fda27eb4d63ded474e5f832019091027ffffffffffffffff5f6af8f7b3396644f18e157960000000000000000000000000105711340daa0d5f769dba1915cef59f0815a5506027d0267a36c0c95b3975ab3ee5b203a7614a3f75373f047d803ae7b6687f2b393909302929092017d57115e47018c7177eebf7cd370a3356a1b7863008a5ae8028c72b88642840160ae1d92915050565b60007ffffffffffffffffffffffffffffffffffffffffffffffffdb731c958f34d94c1821361141f57506000919050565b680755bf798b4a1bf1e58212611491576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4558505f4f564552464c4f5700000000000000000000000000000000000000006044820152606401610428565b6503782dace9d9604e83901b059150600060606bb17217f7d1cf79abc9e3b39884821b056b80000000000000000000000001901d6bb17217f7d1cf79abc9e3b39881029093037fffffffffffffffffffffffffffffffffffffffdbf3ccf1604d263450f02a550481018102606090811d6d0277594991cfc85f6e2461837cd9018202811d7fffffffffffffffffffffffffffffffffffffe5adedaa1cb095af9e4da10e363c018202811d6db1bbb201f443cf962f1a1d3db4a5018202811d7ffffffffffffffffffffffffffffffffffffd38dc772608b0ae56cce01296c0eb018202811d6e05180bb14799ab47a8a8cb2a527d57016d02d16720577bd19bf614176fe9ea6c10fe68e7fd37d0007b713f765084018402831d9081019084017ffffffffffffffffffffffffffffffffffffffe2c69812cf03b0763fd454a8f7e010290911d6e0587f503bb6ea29d25fcb7401964500190910279d835ebba824c98fb31b83b2ca45c000000000000000000000000010574029d9dc38563c32e5c2f6dc192ee70ef65f9978af30260c3939093039290921c92915050565b60008061163986611727565b905061164781868686611759565b9695505050505050565b60008082116116bc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f554e444546494e454400000000000000000000000000000000000000000000006044820152606401610428565b5060016fffffffffffffffffffffffffffffffff821160071b82811c67ffffffffffffffff1060061b1782811c63ffffffff1060051b1782811c61ffff1060041b1782811c60ff10600390811b90911783811c600f1060021b1783811c909110821b1791821c111790565b6060818051906020012060405160200161174391815260200190565b6040516020818303038152906040529050919050565b6000806000611769878686611796565b9150915081801561178b57508051602080830191909120875191880191909120145b979650505050505050565b6000606060006117a58561188b565b905060008060006117b7848a89611986565b815192955090935091501580806117cb5750815b611831576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f50726f76696465642070726f6f6620697320696e76616c69642e0000000000006044820152606401610428565b60008161184d5760405180602001604052806000815250611879565b6118798661185c600188612f93565b8151811061186c5761186c6133f7565b6020026020010151611ea3565b919b919a509098505050505050505050565b6060600061189883611ecd565b90506000815167ffffffffffffffff8111156118b6576118b6612bfa565b6040519080825280602002602001820160405280156118fb57816020015b60408051808201909152606080825260208201528152602001906001900390816118d45790505b50905060005b825181101561197e57600061192e848381518110611921576119216133f7565b6020026020010151611f00565b9050604051806040016040528082815260200161194a83611ecd565b81525083838151811061195f5761195f6133f7565b602002602001018190525050808061197690613367565b915050611901565b509392505050565b6000606081808061199687611faa565b905060008690506000806119bd604051806040016040528060608152602001606081525090565b60005b8c51811015611e5f578c81815181106119db576119db6133f7565b6020026020010151915082846119f191906132e9565b93506119fe6001886132e9565b965083611a7c57815180516020909101208514611a77576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f496e76616c696420726f6f7420686173680000000000000000000000000000006044820152606401610428565b611b6d565b815151602011611af857815180516020909101208514611a77576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f496e76616c6964206c6172676520696e7465726e616c206861736800000000006044820152606401610428565b84611b06836000015161212d565b14611b6d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f496e76616c696420696e7465726e616c206e6f646520686173680000000000006044820152606401610428565b611b79601060016132e9565b8260200151511415611bf2578551841415611b9357611e5f565b6000868581518110611ba757611ba76133f7565b602001015160f81c60f81b60f81c9050600083602001518260ff1681518110611bd257611bd26133f7565b60200260200101519050611be581612155565b9650600194505050611e4d565b60028260200151511415611deb576000611c0b8361218b565b9050600081600081518110611c2257611c226133f7565b016020015160f81c90506000611c39600283613426565b611c44906002613448565b90506000611c55848360ff166121af565b90506000611c638b8a6121af565b90506000611c7183836121e5565b905060ff851660021480611c88575060ff85166003145b15611cde57808351148015611c9d5750808251145b15611caf57611cac818b6132e9565b99505b507f80000000000000000000000000000000000000000000000000000000000000009950611e5f945050505050565b60ff85161580611cf1575060ff85166001145b15611d635782518114611d2d57507f80000000000000000000000000000000000000000000000000000000000000009950611e5f945050505050565b611d548860200151600181518110611d4757611d476133f7565b6020026020010151612155565b9a509750611e4d945050505050565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f52656365697665642061206e6f6465207769746820616e20756e6b6e6f776e2060448201527f70726566697800000000000000000000000000000000000000000000000000006064820152608401610428565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f526563656976656420616e20756e706172736561626c65206e6f64652e0000006044820152606401610428565b80611e5781613367565b9150506119c0565b507f8000000000000000000000000000000000000000000000000000000000000000841486611e8e87866121af565b909e909d50909b509950505050505050505050565b60208101518051606091610f3791611ebd90600190612f93565b81518110611921576119216133f7565b604080518082018252600080825260209182015281518083019092528251825280830190820152606090610f3790612291565b60606000806000611f10856124c4565b919450925090506000816001811115611f2b57611f2b61346b565b14611f92576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f496e76616c696420524c502062797465732076616c75652e00000000000000006044820152606401610428565b611fa1856020015184846128cb565b95945050505050565b6060600082516002611fbc91906131e5565b67ffffffffffffffff811115611fd457611fd4612bfa565b6040519080825280601f01601f191660200182016040528015611ffe576020820181803683370190505b50905060005b8351811015612126576004848281518110612021576120216133f7565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016901c826120568360026131e5565b81518110612066576120666133f7565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060108482815181106120a9576120a96133f7565b01602001516120bb919060f81c613426565b60f81b826120ca8360026131e5565b6120d59060016132e9565b815181106120e5576120e56133f7565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508061211e81613367565b915050612004565b5092915050565b600060208251101561214157506020015190565b81806020019051810190610f37919061349a565b600060606020836000015110156121765761216f836129aa565b9050612182565b61217f83611f00565b90505b6111188161212d565b6060610f376121aa8360200151600081518110611921576119216133f7565b611faa565b6060825182106121ce5750604080516020810190915260008152610f37565b610f3483838486516121e09190612f93565b6129b5565b6000805b8084511180156121f95750808351115b801561227a5750828181518110612212576122126133f7565b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916848281518110612251576122516133f7565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016145b15610f34578061228981613367565b9150506121e9565b606060008061229f846124c4565b919350909150600190508160018111156122bb576122bb61346b565b14612322576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f496e76616c696420524c50206c6973742076616c75652e0000000000000000006044820152606401610428565b6040805160208082526104208201909252600091816020015b604080518082019091526000808252602082015281526020019060019003908161233b5790505090506000835b86518110156124b95760208210612401576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f50726f766964656420524c50206c6973742065786365656473206d6178206c6960448201527f7374206c656e6774682e000000000000000000000000000000000000000000006064820152608401610428565b60008061243e6040518060400160405280858c600001516124229190612f93565b8152602001858c6020015161243791906132e9565b90526124c4565b50915091506040518060400160405280838361245a91906132e9565b8152602001848b6020015161246f91906132e9565b815250858581518110612484576124846133f7565b602090810291909101015261249a6001856132e9565b93506124a681836132e9565b6124b090846132e9565b92505050612368565b508152949350505050565b600080600080846000015111612536576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f524c50206974656d2063616e6e6f74206265206e756c6c2e00000000000000006044820152606401610428565b6020840151805160001a607f811161255b5760006001600094509450945050506128c4565b60b781116125f1576000612570608083612f93565b9050808760000151116125df576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f496e76616c696420524c502073686f727420737472696e672e000000000000006044820152606401610428565b600195509350600092506128c4915050565b60bf811161271457600061260660b783612f93565b905080876000015111612675576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f496e76616c696420524c50206c6f6e6720737472696e67206c656e6774682e006044820152606401610428565b600183015160208290036101000a900461268f81836132e9565b8851116126f8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f496e76616c696420524c50206c6f6e6720737472696e672e00000000000000006044820152606401610428565b6127038260016132e9565b96509450600093506128c492505050565b60f781116127a957600061272960c083612f93565b905080876000015111612798576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f496e76616c696420524c502073686f7274206c6973742e0000000000000000006044820152606401610428565b6001955093508492506128c4915050565b60006127b660f783612f93565b905080876000015111612825576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f496e76616c696420524c50206c6f6e67206c697374206c656e6774682e0000006044820152606401610428565b600183015160208290036101000a900461283f81836132e9565b8851116128a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c696420524c50206c6f6e67206c6973742e000000000000000000006044820152606401610428565b6128b38260016132e9565b96509450600193506128c492505050565b9193909250565b606060008267ffffffffffffffff8111156128e8576128e8612bfa565b6040519080825280601f01601f191660200182016040528015612912576020820181803683370190505b509050805160001415612926579050611118565b600061293285876132e9565b90506020820160005b612946602087613286565b81101561297d578251825261295c6020846132e9565b92506129696020836132e9565b91508061297581613367565b91505061293b565b5060006001602087066020036101000a039050808251168119845116178252839450505050509392505050565b6060610f3782612ba2565b6060816129c381601f6132e9565b1015612a2b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f770000000000000000000000000000000000006044820152606401610428565b82612a3683826132e9565b1015612a9e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f770000000000000000000000000000000000006044820152606401610428565b612aa882846132e9565b84511015612b12576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f736c6963655f6f75744f66426f756e64730000000000000000000000000000006044820152606401610428565b606082158015612b315760405191506000825260208201604052612b99565b6040519150601f8416801560200281840101858101878315602002848b0101015b81831015612b6a578051835260209283019201612b52565b5050858452601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016604052505b50949350505050565b6060610f378260200151600084600001516128cb565b600060208284031215612bca57600080fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff81168114612bf557600080fd5b919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715612c7057612c70612bfa565b604052919050565b600080600080600060a08688031215612c9057600080fd5b612c9986612bd1565b94506020808701359450604087013567ffffffffffffffff8082168214612cbf57600080fd5b9094506060880135908115158214612cd657600080fd5b90935060808801359080821115612cec57600080fd5b818901915089601f830112612d0057600080fd5b813581811115612d1257612d12612bfa565b612d42847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601612c29565b91508082528a84828501011115612d5857600080fd5b80848401858401376000848284010152508093505050509295509295909350565b60008083601f840112612d8b57600080fd5b50813567ffffffffffffffff811115612da357600080fd5b602083019150836020828501011115612dbb57600080fd5b9250929050565b60008060008060008060008060008060006101808c8e031215612de457600080fd5b8b359a50612df460208d01612bd1565b9950612e0260408d01612bd1565b985060608c0135975060808c0135965067ffffffffffffffff60a08d01351115612e2b57600080fd5b612e3b8d60a08e01358e01612d79565b909650945060c08c0135935060808c8e037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff20011215612e7957600080fd5b60e08c01925067ffffffffffffffff6101608d01351115612e9957600080fd5b612eaa8d6101608e01358e01612d79565b81935080925050509295989b509295989b9093969950565b6000815180845260005b81811015612ee857602081850181015186830182015201612ecc565b81811115612efa576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b85815284602082015267ffffffffffffffff84166040820152821515606082015260a06080820152600061178b60a0830184612ec2565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082821015612fa557612fa5612f64565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082612fe857612fe8612faa565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83147f80000000000000000000000000000000000000000000000000000000000000008314161561303c5761303c612f64565b500590565b6000808312837f80000000000000000000000000000000000000000000000000000000000000000183128115161561307b5761307b612f64565b837f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0183138116156130af576130af612f64565b50500390565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000841360008413858304851182821616156130f6576130f6612f64565b7f8000000000000000000000000000000000000000000000000000000000000000600087128682058812818416161561313157613131612f64565b6000871292508782058712848416161561314d5761314d612f64565b8785058712818416161561316357613163612f64565b505050929093029392505050565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038413811516156131ab576131ab612f64565b827f80000000000000000000000000000000000000000000000000000000000000000384128116156131df576131df612f64565b50500190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561321d5761321d612f64565b500290565b600067ffffffffffffffff80831681851680830382111561324557613245612f64565b01949350505050565b60006fffffffffffffffffffffffffffffffff8083168185168183048111821515161561327d5761327d612f64565b02949350505050565b60008261329557613295612faa565b500490565b6000604082840312156132ac57600080fd5b6040516040810181811067ffffffffffffffff821117156132cf576132cf612bfa565b604052825181526020928301519281019290925250919050565b600082198211156132fc576132fc612f64565b500190565b60006080828403121561331357600080fd5b6040516080810181811067ffffffffffffffff8211171561333657613336612bfa565b8060405250823581526020830135602082015260408301356040820152606083013560608201528091505092915050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561339957613399612f64565b5060010190565b868152600073ffffffffffffffffffffffffffffffffffffffff808816602084015280871660408401525084606083015283608083015260c060a08301526133eb60c0830184612ec2565b98975050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060ff83168061343957613439612faa565b8060ff84160691505092915050565b600060ff821660ff84168082101561346257613462612f64565b90039392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6000602082840312156134ac57600080fd5b505191905056fea164736f6c634300080a000a" var OptimismPortalDeployedBin = "0x6080604052600436106100f65760003560e01c80639bf62d821161008a578063cff0ab9611610059578063cff0ab96146102fc578063e9e05c421461039d578063eecf1c36146103b0578063f4daa291146103c357600080fd5b80639bf62d8214610275578063a14238e7146102a2578063ca3e99ba146102d2578063cd7c9789146102e757600080fd5b80636bb0291e116100c65780636bb0291e146102055780636dbffb781461021a5780638129fc1c1461024a578063867ead131461025f57600080fd5b80621c2ff61461012257806313620abd1461018057806335c14a16146101b957806364b79208146101e057600080fd5b3661011d5761011b3334620186a06000604051806020016040528060008152506103f7565b005b600080fd5b34801561012e57600080fd5b506101567f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b34801561018c57600080fd5b50610198633b9aca0081565b6040516fffffffffffffffffffffffffffffffff9091168152602001610177565b3480156101c557600080fd5b506101ce600181565b60405160ff9091168152602001610177565b3480156101ec57600080fd5b506101f7627a120081565b604051908152602001610177565b34801561021157600080fd5b506101f7600481565b34801561022657600080fd5b5061023a610235366004613216565b61089d565b6040519015158152602001610177565b34801561025657600080fd5b5061011b610bab565b34801561026b57600080fd5b506101f761271081565b34801561028157600080fd5b506033546101569073ffffffffffffffffffffffffffffffffffffffff1681565b3480156102ae57600080fd5b5061023a6102bd366004613216565b60346020526000908152604090205460ff1681565b3480156102de57600080fd5b506101f7610cd1565b3480156102f357600080fd5b506101f7600881565b34801561030857600080fd5b50600154610364906fffffffffffffffffffffffffffffffff81169067ffffffffffffffff7001000000000000000000000000000000008204811691780100000000000000000000000000000000000000000000000090041683565b604080516fffffffffffffffffffffffffffffffff909416845267ffffffffffffffff9283166020850152911690820152606001610177565b61011b6103ab3660046132d1565b6103f7565b61011b6103be36600461341b565b610ce2565b3480156103cf57600080fd5b506101f77f000000000000000000000000000000000000000000000000000000000000000081565b8260005a905083156104ae5773ffffffffffffffffffffffffffffffffffffffff8716156104ae57604080517f08c379a00000000000000000000000000000000000000000000000000000000081526020600482015260248101919091527f4f7074696d69736d506f7274616c3a206d7573742073656e6420746f2061646460448201527f72657373283029207768656e206372656174696e67206120636f6e747261637460648201526084015b60405180910390fd5b333281146104cf575033731111000000000000000000000000000000001111015b8773ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f78231ae6eb73366f912bb1d64351601fb76344c537bbab635ce14d0f376f0195348a8a8a8a604051610534959493929190613586565b60405180910390a350600154600090610573907801000000000000000000000000000000000000000000000000900467ffffffffffffffff16436135ec565b905080156106fc57600061058b6004627a1200613632565b6001546105b69190700100000000000000000000000000000000900467ffffffffffffffff1661369a565b9050600060086105ca6004627a1200613632565b6001546105ea9085906fffffffffffffffffffffffffffffffff1661370e565b6105f49190613632565b6105fe9190613632565b60015490915060009061064a906106349061062c9085906fffffffffffffffffffffffffffffffff166137ca565b6127106113f5565b6fffffffffffffffffffffffffffffffff611410565b905060018411156106bd576106ba610634670de0b6b3a76400006106a6610672600883613632565b61068490670de0b6b3a764000061369a565b61068f60018a6135ec565b6106a190670de0b6b3a764000061383e565b61141f565b6106b0908561370e565b61062c9190613632565b90505b6fffffffffffffffffffffffffffffffff16780100000000000000000000000000000000000000000000000067ffffffffffffffff4316021760015550505b6001805484919060109061072f908490700100000000000000000000000000000000900467ffffffffffffffff1661387b565b92506101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550627a1200600160000160109054906101000a900467ffffffffffffffff1667ffffffffffffffff16131561080b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603c60248201527f4f7074696d69736d506f7274616c3a2063616e6e6f7420627579206d6f72652060448201527f676173207468616e20617661696c61626c6520676173206c696d69740000000060648201526084016104a5565b600154600090610837906fffffffffffffffffffffffffffffffff1667ffffffffffffffff86166138a7565b6fffffffffffffffffffffffffffffffff169050600061085b48633b9aca00611450565b61086590836138df565b905060005a61087490866135ec565b9050808211156108905761089061088b82846135ec565b611460565b5050505050505050505050565b6040517fa25ae55700000000000000000000000000000000000000000000000000000000815260048101829052600090819073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063a25ae557906024016040805180830381865afa15801561092c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095091906138f3565b8051909150610b725760007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663529933df6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ea9190613942565b905060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16634ab65d736040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a59573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7d9190613942565b905084811115610a9257506000949350505050565b600082610a9f83886135ec565b610aa9919061395b565b905073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001663a25ae557610af183866135ec565b610afb908961396f565b6040518263ffffffff1660e01b8152600401610b1991815260200190565b6040805180830381865afa158015610b35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5991906138f3565b8051909450610b6e5750600095945050505050565b5050505b7f00000000000000000000000000000000000000000000000000000000000000008160200151610ba2919061396f565b42119392505050565b60016000610bb88261148e565b90508015610bed57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b603380547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead179055610c6860408051606081018252633b9aca00808252600060208301524367ffffffffffffffff169190920181905278010000000000000000000000000000000000000000000000000217600155565b8015610ccd57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16905560405160ff831681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b610cdf6004627a1200613632565b81565b60335473ffffffffffffffffffffffffffffffffffffffff1661dead14610d8b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f4f7074696d69736d506f7274616c3a2063616e206f6e6c79207472696767657260448201527f206f6e65207769746864726177616c20706572207472616e73616374696f6e0060648201526084016104a5565b73ffffffffffffffffffffffffffffffffffffffff8916301415610e31576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f4f7074696d69736d506f7274616c3a20796f752063616e6e6f742073656e642060448201527f6d6573736167657320746f2074686520706f7274616c20636f6e74726163740060648201526084016104a5565b6040517fa25ae557000000000000000000000000000000000000000000000000000000008152600481018590526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063a25ae557906024016040805180830381865afa158015610ebe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ee291906138f3565b90507f00000000000000000000000000000000000000000000000000000000000000008160200151610f14919061396f565b4211610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4f7074696d69736d506f7274616c3a2070726f706f73616c206973206e6f742060448201527f7965742066696e616c697a65640000000000000000000000000000000000000060648201526084016104a5565b610fb9610fb436869003860186613987565b611619565b815114611048576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4f7074696d69736d506f7274616c3a20696e76616c6964206f7574707574207260448201527f6f6f742070726f6f66000000000000000000000000000000000000000000000060648201526084016104a5565b600061108e8d8d8d8d8d8d8d8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061167592505050565b90506110d581866040013586868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506116b492505050565b611161576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4f7074696d69736d506f7274616c3a20696e76616c696420776974686472617760448201527f616c20696e636c7573696f6e2070726f6f66000000000000000000000000000060648201526084016104a5565b60008181526034602052604090205460ff1615611200576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f4f7074696d69736d506f7274616c3a207769746864726177616c20686173206160448201527f6c7265616479206265656e2066696e616c697a6564000000000000000000000060648201526084016104a5565b600081815260346020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055611243614e208a61396f565b5a10156112d2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f4f7074696d69736d506f7274616c3a20696e73756666696369656e742067617360448201527f20746f2066696e616c697a65207769746864726177616c00000000000000000060648201526084016104a5565b603380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8e16179055604080516020601f8a0181900481028201810190925288815260009161135b918e918d918f918691908f908f908190840183828082843760009201919091525061177d92505050565b50603380547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead17905560405190915082907fdb5c7652857aa163daadd670e116628fb42e869d8ac4251ef8971d9e5727df1b906113c190841515815260200190565b60405180910390a25050505050505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b6000818312156114055781611407565b825b90505b92915050565b60008183126114055781611407565b6000611407670de0b6b3a76400008361143786611808565b611441919061370e565b61144b9190613632565b611a4c565b6000818310156114055781611407565b6000805a90505b825a61147390836135ec565b101561148957611482826139ed565b9150611467565b505050565b60008054610100900460ff1615611545578160ff1660011480156114b15750303b155b61153d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016104a5565b506000919050565b60005460ff8084169116106115dc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016104a5565b50600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff92909216919091179055600190565b919050565b60008160000151826020015183604001518460600151604051602001611658949392919093845260208401929092526040830152606082015260800190565b604051602081830303815290604052805190602001209050919050565b600086868686868660405160200161169296959493929190613a26565b6040516020818303038152906040528051906020012090509695505050505050565b604080516020810185905260009181018290528190606001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152828252805160209182012090830181905292506117729101604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152828201909152600182527f01000000000000000000000000000000000000000000000000000000000000006020830152908587611c8b565b9150505b9392505050565b6000606060008060008661ffff1667ffffffffffffffff8111156117a3576117a3613253565b6040519080825280601f01601f1916602001820160405280156117cd576020820181803683370190505b5090506000808751602089018b8e8ef191503d9250868311156117ee578692505b828152826000602083013e90999098509650505050505050565b6000808213611873576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f554e444546494e4544000000000000000000000000000000000000000000000060448201526064016104a5565b6000606061188084611caf565b03609f8181039490941b90931c6c465772b2bbbb5f824b15207a3081018102606090811d6d0388eaa27412d5aca026815d636e018202811d6d0df99ac502031bf953eff472fdcc018202811d6d13cdffb29d51d99322bdff5f2211018202811d6d0a0f742023def783a307a986912e018202811d6d01920d8043ca89b5239253284e42018202811d6c0b7a86d7375468fac667a0a527016c29508e458543d8aa4df2abee7883018302821d6d0139601a2efabe717e604cbb4894018302821d6d02247f7a7b6594320649aa03aba1018302821d7fffffffffffffffffffffffffffffffffffffff73c0c716a594e00d54e3c4cbc9018302821d7ffffffffffffffffffffffffffffffffffffffdc7b88c420e53a9890533129f6f01830290911d7fffffffffffffffffffffffffffffffffffffff465fda27eb4d63ded474e5f832019091027ffffffffffffffff5f6af8f7b3396644f18e157960000000000000000000000000105711340daa0d5f769dba1915cef59f0815a5506027d0267a36c0c95b3975ab3ee5b203a7614a3f75373f047d803ae7b6687f2b393909302929092017d57115e47018c7177eebf7cd370a3356a1b7863008a5ae8028c72b88642840160ae1d92915050565b60007ffffffffffffffffffffffffffffffffffffffffffffffffdb731c958f34d94c18213611a7d57506000919050565b680755bf798b4a1bf1e58212611aef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4558505f4f564552464c4f57000000000000000000000000000000000000000060448201526064016104a5565b6503782dace9d9604e83901b059150600060606bb17217f7d1cf79abc9e3b39884821b056b80000000000000000000000001901d6bb17217f7d1cf79abc9e3b39881029093037fffffffffffffffffffffffffffffffffffffffdbf3ccf1604d263450f02a550481018102606090811d6d0277594991cfc85f6e2461837cd9018202811d7fffffffffffffffffffffffffffffffffffffe5adedaa1cb095af9e4da10e363c018202811d6db1bbb201f443cf962f1a1d3db4a5018202811d7ffffffffffffffffffffffffffffffffffffd38dc772608b0ae56cce01296c0eb018202811d6e05180bb14799ab47a8a8cb2a527d57016d02d16720577bd19bf614176fe9ea6c10fe68e7fd37d0007b713f765084018402831d9081019084017ffffffffffffffffffffffffffffffffffffffe2c69812cf03b0763fd454a8f7e010290911d6e0587f503bb6ea29d25fcb7401964500190910279d835ebba824c98fb31b83b2ca45c000000000000000000000000010574029d9dc38563c32e5c2f6dc192ee70ef65f9978af30260c3939093039290921c92915050565b600080611c9786611d85565b9050611ca581868686611db7565b9695505050505050565b6000808211611d1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f554e444546494e4544000000000000000000000000000000000000000000000060448201526064016104a5565b5060016fffffffffffffffffffffffffffffffff821160071b82811c67ffffffffffffffff1060061b1782811c63ffffffff1060051b1782811c61ffff1060041b1782811c60ff10600390811b90911783811c600f1060021b1783811c909110821b1791821c111790565b60608180519060200120604051602001611da191815260200190565b6040516020818303038152906040529050919050565b6000806000611dc7878686611df4565b91509150818015611de957508051602080830191909120875191880191909120145b979650505050505050565b600060606000611e0385611ee9565b90506000806000611e15848a89611fe4565b81519295509093509150158080611e295750815b611e8f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f50726f76696465642070726f6f6620697320696e76616c69642e00000000000060448201526064016104a5565b600081611eab5760405180602001604052806000815250611ed7565b611ed786611eba6001886135ec565b81518110611eca57611eca613a7d565b6020026020010151612501565b919b919a509098505050505050505050565b60606000611ef68361252b565b90506000815167ffffffffffffffff811115611f1457611f14613253565b604051908082528060200260200182016040528015611f5957816020015b6040805180820190915260608082526020820152815260200190600190039081611f325790505b50905060005b8251811015611fdc576000611f8c848381518110611f7f57611f7f613a7d565b602002602001015161255e565b90506040518060400160405280828152602001611fa88361252b565b815250838381518110611fbd57611fbd613a7d565b6020026020010181905250508080611fd4906139ed565b915050611f5f565b509392505050565b60006060818080611ff487612608565b9050600086905060008061201b604051806040016040528060608152602001606081525090565b60005b8c518110156124bd578c818151811061203957612039613a7d565b60200260200101519150828461204f919061396f565b935061205c60018861396f565b9650836120da578151805160209091012085146120d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f496e76616c696420726f6f74206861736800000000000000000000000000000060448201526064016104a5565b6121cb565b815151602011612156578151805160209091012085146120d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f496e76616c6964206c6172676520696e7465726e616c2068617368000000000060448201526064016104a5565b84612164836000015161278b565b146121cb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f496e76616c696420696e7465726e616c206e6f6465206861736800000000000060448201526064016104a5565b6121d76010600161396f565b82602001515114156122505785518414156121f1576124bd565b600086858151811061220557612205613a7d565b602001015160f81c60f81b60f81c9050600083602001518260ff168151811061223057612230613a7d565b60200260200101519050612243816127b3565b96506001945050506124ab565b60028260200151511415612449576000612269836127e9565b905060008160008151811061228057612280613a7d565b016020015160f81c90506000612297600283613aac565b6122a2906002613ace565b905060006122b3848360ff1661280d565b905060006122c18b8a61280d565b905060006122cf8383612843565b905060ff8516600214806122e6575060ff85166003145b1561233c578083511480156122fb5750808251145b1561230d5761230a818b61396f565b99505b507f800000000000000000000000000000000000000000000000000000000000000099506124bd945050505050565b60ff8516158061234f575060ff85166001145b156123c1578251811461238b57507f800000000000000000000000000000000000000000000000000000000000000099506124bd945050505050565b6123b288602001516001815181106123a5576123a5613a7d565b60200260200101516127b3565b9a5097506124ab945050505050565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f52656365697665642061206e6f6465207769746820616e20756e6b6e6f776e2060448201527f707265666978000000000000000000000000000000000000000000000000000060648201526084016104a5565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f526563656976656420616e20756e706172736561626c65206e6f64652e00000060448201526064016104a5565b806124b5816139ed565b91505061201e565b507f80000000000000000000000000000000000000000000000000000000000000008414866124ec878661280d565b909e909d50909b509950505050505050505050565b6020810151805160609161140a9161251b906001906135ec565b81518110611f7f57611f7f613a7d565b60408051808201825260008082526020918201528151808301909252825182528083019082015260609061140a906128ef565b6060600080600061256e85612b22565b91945092509050600081600181111561258957612589613af1565b146125f0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f496e76616c696420524c502062797465732076616c75652e000000000000000060448201526064016104a5565b6125ff85602001518484612f29565b95945050505050565b606060008251600261261a919061383e565b67ffffffffffffffff81111561263257612632613253565b6040519080825280601f01601f19166020018201604052801561265c576020820181803683370190505b50905060005b835181101561278457600484828151811061267f5761267f613a7d565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016901c826126b483600261383e565b815181106126c4576126c4613a7d565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350601084828151811061270757612707613a7d565b0160200151612719919060f81c613aac565b60f81b8261272883600261383e565b61273390600161396f565b8151811061274357612743613a7d565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508061277c816139ed565b915050612662565b5092915050565b600060208251101561279f57506020015190565b8180602001905181019061140a9190613942565b600060606020836000015110156127d4576127cd83613008565b90506127e0565b6127dd8361255e565b90505b6117768161278b565b606061140a6128088360200151600081518110611f7f57611f7f613a7d565b612608565b60608251821061282c575060408051602081019091526000815261140a565b611407838384865161283e91906135ec565b613013565b6000805b8084511180156128575750808351115b80156128d8575082818151811061287057612870613a7d565b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168482815181106128af576128af613a7d565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016145b1561140757806128e7816139ed565b915050612847565b60606000806128fd84612b22565b9193509091506001905081600181111561291957612919613af1565b14612980576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f496e76616c696420524c50206c6973742076616c75652e00000000000000000060448201526064016104a5565b6040805160208082526104208201909252600091816020015b60408051808201909152600080825260208201528152602001906001900390816129995790505090506000835b8651811015612b175760208210612a5f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f50726f766964656420524c50206c6973742065786365656473206d6178206c6960448201527f7374206c656e6774682e0000000000000000000000000000000000000000000060648201526084016104a5565b600080612a9c6040518060400160405280858c60000151612a8091906135ec565b8152602001858c60200151612a95919061396f565b9052612b22565b509150915060405180604001604052808383612ab8919061396f565b8152602001848b60200151612acd919061396f565b815250858581518110612ae257612ae2613a7d565b6020908102919091010152612af860018561396f565b9350612b04818361396f565b612b0e908461396f565b925050506129c6565b508152949350505050565b600080600080846000015111612b94576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f524c50206974656d2063616e6e6f74206265206e756c6c2e000000000000000060448201526064016104a5565b6020840151805160001a607f8111612bb9576000600160009450945094505050612f22565b60b78111612c4f576000612bce6080836135ec565b905080876000015111612c3d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f496e76616c696420524c502073686f727420737472696e672e0000000000000060448201526064016104a5565b60019550935060009250612f22915050565b60bf8111612d72576000612c6460b7836135ec565b905080876000015111612cd3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f496e76616c696420524c50206c6f6e6720737472696e67206c656e6774682e0060448201526064016104a5565b600183015160208290036101000a9004612ced818361396f565b885111612d56576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f496e76616c696420524c50206c6f6e6720737472696e672e000000000000000060448201526064016104a5565b612d6182600161396f565b9650945060009350612f2292505050565b60f78111612e07576000612d8760c0836135ec565b905080876000015111612df6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f496e76616c696420524c502073686f7274206c6973742e00000000000000000060448201526064016104a5565b600195509350849250612f22915050565b6000612e1460f7836135ec565b905080876000015111612e83576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f496e76616c696420524c50206c6f6e67206c697374206c656e6774682e00000060448201526064016104a5565b600183015160208290036101000a9004612e9d818361396f565b885111612f06576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c696420524c50206c6f6e67206c6973742e0000000000000000000060448201526064016104a5565b612f1182600161396f565b9650945060019350612f2292505050565b9193909250565b606060008267ffffffffffffffff811115612f4657612f46613253565b6040519080825280601f01601f191660200182016040528015612f70576020820181803683370190505b509050805160001415612f84579050611776565b6000612f90858761396f565b90506020820160005b612fa46020876138df565b811015612fdb5782518252612fba60208461396f565b9250612fc760208361396f565b915080612fd3816139ed565b915050612f99565b5060006001602087066020036101000a039050808251168119845116178252839450505050509392505050565b606061140a82613200565b60608161302181601f61396f565b1015613089576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f7700000000000000000000000000000000000060448201526064016104a5565b82613094838261396f565b10156130fc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f7700000000000000000000000000000000000060448201526064016104a5565b613106828461396f565b84511015613170576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f736c6963655f6f75744f66426f756e647300000000000000000000000000000060448201526064016104a5565b60608215801561318f57604051915060008252602082016040526131f7565b6040519150601f8416801560200281840101858101878315602002848b0101015b818310156131c85780518352602092830192016131b0565b5050858452601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016604052505b50949350505050565b606061140a826020015160008460000151612f29565b60006020828403121561322857600080fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461161457600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156132c9576132c9613253565b604052919050565b600080600080600060a086880312156132e957600080fd5b6132f28661322f565b94506020808701359450604087013567ffffffffffffffff808216821461331857600080fd5b909450606088013590811515821461332f57600080fd5b9093506080880135908082111561334557600080fd5b818901915089601f83011261335957600080fd5b81358181111561336b5761336b613253565b61339b847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601613282565b91508082528a848285010111156133b157600080fd5b80848401858401376000848284010152508093505050509295509295909350565b60008083601f8401126133e457600080fd5b50813567ffffffffffffffff8111156133fc57600080fd5b60208301915083602082850101111561341457600080fd5b9250929050565b60008060008060008060008060008060006101808c8e03121561343d57600080fd5b8b359a5061344d60208d0161322f565b995061345b60408d0161322f565b985060608c0135975060808c0135965067ffffffffffffffff60a08d0135111561348457600080fd5b6134948d60a08e01358e016133d2565b909650945060c08c0135935060808c8e037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff200112156134d257600080fd5b60e08c01925067ffffffffffffffff6101608d013511156134f257600080fd5b6135038d6101608e01358e016133d2565b81935080925050509295989b509295989b9093969950565b6000815180845260005b8181101561354157602081850181015186830182015201613525565b81811115613553576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b85815284602082015267ffffffffffffffff84166040820152821515606082015260a060808201526000611de960a083018461351b565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000828210156135fe576135fe6135bd565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261364157613641613603565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83147f800000000000000000000000000000000000000000000000000000000000000083141615613695576136956135bd565b500590565b6000808312837f8000000000000000000000000000000000000000000000000000000000000000018312811516156136d4576136d46135bd565b837f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018313811615613708576137086135bd565b50500390565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60008413600084138583048511828216161561374f5761374f6135bd565b7f8000000000000000000000000000000000000000000000000000000000000000600087128682058812818416161561378a5761378a6135bd565b600087129250878205871284841616156137a6576137a66135bd565b878505871281841616156137bc576137bc6135bd565b505050929093029392505050565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03841381151615613804576138046135bd565b827f8000000000000000000000000000000000000000000000000000000000000000038412811615613838576138386135bd565b50500190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613876576138766135bd565b500290565b600067ffffffffffffffff80831681851680830382111561389e5761389e6135bd565b01949350505050565b60006fffffffffffffffffffffffffffffffff808316818516818304811182151516156138d6576138d66135bd565b02949350505050565b6000826138ee576138ee613603565b500490565b60006040828403121561390557600080fd5b6040516040810181811067ffffffffffffffff8211171561392857613928613253565b604052825181526020928301519281019290925250919050565b60006020828403121561395457600080fd5b5051919050565b60008261396a5761396a613603565b500690565b60008219821115613982576139826135bd565b500190565b60006080828403121561399957600080fd5b6040516080810181811067ffffffffffffffff821117156139bc576139bc613253565b8060405250823581526020830135602082015260408301356040820152606083013560608201528091505092915050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a1f57613a1f6135bd565b5060010190565b868152600073ffffffffffffffffffffffffffffffffffffffff808816602084015280871660408401525084606083015283608083015260c060a0830152613a7160c083018461351b565b98975050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060ff831680613abf57613abf613603565b8060ff84160691505092915050565b600060ff821660ff841680821015613ae857613ae86135bd565b90039392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea164736f6c634300080a000a"
...@@ -12,6 +12,7 @@ import ( ...@@ -12,6 +12,7 @@ import (
bss "github.com/ethereum-optimism/optimism/op-batcher" bss "github.com/ethereum-optimism/optimism/op-batcher"
"github.com/ethereum-optimism/optimism/op-bindings/bindings" "github.com/ethereum-optimism/optimism/op-bindings/bindings"
"github.com/ethereum-optimism/optimism/op-bindings/predeploys" "github.com/ethereum-optimism/optimism/op-bindings/predeploys"
"github.com/ethereum-optimism/optimism/op-node/metrics"
rollupNode "github.com/ethereum-optimism/optimism/op-node/node" 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"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
...@@ -507,7 +508,7 @@ func (cfg SystemConfig) start() (*System, error) { ...@@ -507,7 +508,7 @@ func (cfg SystemConfig) start() (*System, error) {
} }
} }
node, err := rollupNode.New(context.Background(), &c, cfg.Loggers[name], cfg.Loggers[name], "") node, err := rollupNode.New(context.Background(), &c, cfg.Loggers[name], cfg.Loggers[name], "", metrics.NewMetrics(""))
if err != nil { if err != nil {
didErrAfterStart = true didErrAfterStart = true
return nil, err return nil, err
......
package client
import (
"context"
"math/big"
"github.com/ethereum-optimism/optimism/op-node/metrics"
"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"
)
type Client interface {
Close()
ChainID(ctx context.Context) (*big.Int, error)
BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error)
BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)
BlockNumber(ctx context.Context) (uint64, error)
PeerCount(ctx context.Context) (uint64, error)
HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error)
HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)
TransactionByHash(ctx context.Context, hash common.Hash) (tx *types.Transaction, isPending bool, err error)
TransactionSender(ctx context.Context, tx *types.Transaction, block common.Hash, index uint) (common.Address, error)
TransactionCount(ctx context.Context, blockHash common.Hash) (uint, error)
TransactionInBlock(ctx context.Context, blockHash common.Hash, index uint) (*types.Transaction, error)
TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)
SyncProgress(ctx context.Context) (*ethereum.SyncProgress, error)
SubscribeNewHead(ctx context.Context, ch chan<- *types.Header) (ethereum.Subscription, error)
NetworkID(ctx context.Context) (*big.Int, error)
BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)
StorageAt(ctx context.Context, account common.Address, key common.Hash, blockNumber *big.Int) ([]byte, error)
CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error)
NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error)
FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error)
SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error)
PendingBalanceAt(ctx context.Context, account common.Address) (*big.Int, error)
PendingStorageAt(ctx context.Context, account common.Address, key common.Hash) ([]byte, error)
PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error)
PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)
PendingTransactionCount(ctx context.Context) (uint, error)
CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)
CallContractAtHash(ctx context.Context, msg ethereum.CallMsg, blockHash common.Hash) ([]byte, error)
PendingCallContract(ctx context.Context, msg ethereum.CallMsg) ([]byte, error)
SuggestGasPrice(ctx context.Context) (*big.Int, error)
SuggestGasTipCap(ctx context.Context) (*big.Int, error)
EstimateGas(ctx context.Context, msg ethereum.CallMsg) (uint64, error)
SendTransaction(ctx context.Context, tx *types.Transaction) error
}
// InstrumentedClient is an Ethereum client that tracks
// Prometheus metrics for each call.
type InstrumentedClient struct {
c *ethclient.Client
m *metrics.Metrics
}
// NewInstrumentedClient creates a new instrumented client. It takes
// a concrete *rpc.Client to prevent people from passing in an already
// instrumented client.
func NewInstrumentedClient(c *rpc.Client, m *metrics.Metrics) *InstrumentedClient {
return &InstrumentedClient{
c: ethclient.NewClient(c),
m: m,
}
}
func (ic *InstrumentedClient) Close() {
ic.c.Close()
}
func (ic *InstrumentedClient) ChainID(ctx context.Context) (*big.Int, error) {
return instrument2[*big.Int](ic.m, "eth_chainId", func() (*big.Int, error) {
return ic.c.ChainID(ctx)
})
}
func (ic *InstrumentedClient) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error) {
return instrument2[*types.Block](ic.m, "eth_getBlockByHash", func() (*types.Block, error) {
return ic.c.BlockByHash(ctx, hash)
})
}
func (ic *InstrumentedClient) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error) {
return instrument2[*types.Block](ic.m, "eth_getBlockByNumber", func() (*types.Block, error) {
return ic.c.BlockByNumber(ctx, number)
})
}
func (ic *InstrumentedClient) BlockNumber(ctx context.Context) (uint64, error) {
return instrument2[uint64](ic.m, "eth_blockNumber", func() (uint64, error) {
return ic.c.BlockNumber(ctx)
})
}
func (ic *InstrumentedClient) PeerCount(ctx context.Context) (uint64, error) {
return instrument2[uint64](ic.m, "net_peerCount", func() (uint64, error) {
return ic.c.PeerCount(ctx)
})
}
func (ic *InstrumentedClient) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error) {
return instrument2[*types.Header](ic.m, "eth_getHeaderByHash", func() (*types.Header, error) {
return ic.c.HeaderByHash(ctx, hash)
})
}
func (ic *InstrumentedClient) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error) {
return instrument2[*types.Header](ic.m, "eth_getHeaderByNumber", func() (*types.Header, error) {
return ic.c.HeaderByNumber(ctx, number)
})
}
func (ic *InstrumentedClient) TransactionByHash(ctx context.Context, hash common.Hash) (*types.Transaction, bool, error) {
record := ic.m.RecordRPCClientRequest("eth_getTransactionByHash")
tx, isPending, err := ic.c.TransactionByHash(ctx, hash)
record(err)
return tx, isPending, err
}
func (ic *InstrumentedClient) TransactionSender(ctx context.Context, tx *types.Transaction, block common.Hash, index uint) (common.Address, error) {
return ic.c.TransactionSender(ctx, tx, block, index)
}
func (ic *InstrumentedClient) TransactionCount(ctx context.Context, blockHash common.Hash) (uint, error) {
return instrument2[uint](ic.m, "eth_getTransactionCount", func() (uint, error) {
return ic.c.TransactionCount(ctx, blockHash)
})
}
func (ic *InstrumentedClient) TransactionInBlock(ctx context.Context, blockHash common.Hash, index uint) (*types.Transaction, error) {
return instrument2[*types.Transaction](ic.m, "eth_getTransactionByBlockHashAndIndex", func() (*types.Transaction, error) {
return ic.c.TransactionInBlock(ctx, blockHash, index)
})
}
func (ic *InstrumentedClient) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error) {
return instrument2[*types.Receipt](ic.m, "eth_getTransactionReceipt", func() (*types.Receipt, error) {
return ic.c.TransactionReceipt(ctx, txHash)
})
}
func (ic *InstrumentedClient) SyncProgress(ctx context.Context) (*ethereum.SyncProgress, error) {
return instrument2[*ethereum.SyncProgress](ic.m, "eth_syncing", func() (*ethereum.SyncProgress, error) {
return ic.c.SyncProgress(ctx)
})
}
func (ic *InstrumentedClient) SubscribeNewHead(ctx context.Context, ch chan<- *types.Header) (ethereum.Subscription, error) {
return ic.c.SubscribeNewHead(ctx, ch)
}
func (ic *InstrumentedClient) NetworkID(ctx context.Context) (*big.Int, error) {
return instrument2[*big.Int](ic.m, "net_version", func() (*big.Int, error) {
return ic.c.NetworkID(ctx)
})
}
func (ic *InstrumentedClient) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error) {
return instrument2[*big.Int](ic.m, "eth_getBalance", func() (*big.Int, error) {
return ic.c.BalanceAt(ctx, account, blockNumber)
})
}
func (ic *InstrumentedClient) StorageAt(ctx context.Context, account common.Address, key common.Hash, blockNumber *big.Int) ([]byte, error) {
return instrument2[[]byte](ic.m, "eth_getStorageAt", func() ([]byte, error) {
return ic.c.StorageAt(ctx, account, key, blockNumber)
})
}
func (ic *InstrumentedClient) CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error) {
return instrument2[[]byte](ic.m, "eth_getCode", func() ([]byte, error) {
return ic.c.CodeAt(ctx, account, blockNumber)
})
}
func (ic *InstrumentedClient) NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error) {
return instrument2[uint64](ic.m, "eth_getTransactionCount", func() (uint64, error) {
return ic.c.NonceAt(ctx, account, blockNumber)
})
}
func (ic *InstrumentedClient) FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error) {
return instrument2[[]types.Log](ic.m, "eth_getLogs", func() ([]types.Log, error) {
return ic.c.FilterLogs(ctx, q)
})
}
func (ic *InstrumentedClient) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error) {
return ic.c.SubscribeFilterLogs(ctx, q, ch)
}
func (ic *InstrumentedClient) PendingBalanceAt(ctx context.Context, account common.Address) (*big.Int, error) {
return instrument2[*big.Int](ic.m, "eth_getBalance", func() (*big.Int, error) {
return ic.c.PendingBalanceAt(ctx, account)
})
}
func (ic *InstrumentedClient) PendingStorageAt(ctx context.Context, account common.Address, key common.Hash) ([]byte, error) {
return instrument2[[]byte](ic.m, "eth_getStorageAt", func() ([]byte, error) {
return ic.c.PendingStorageAt(ctx, account, key)
})
}
func (ic *InstrumentedClient) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error) {
return instrument2[[]byte](ic.m, "eth_getCode", func() ([]byte, error) {
return ic.c.PendingCodeAt(ctx, account)
})
}
func (ic *InstrumentedClient) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error) {
return instrument2[uint64](ic.m, "eth_getTransactionCount", func() (uint64, error) {
return ic.c.PendingNonceAt(ctx, account)
})
}
func (ic *InstrumentedClient) PendingTransactionCount(ctx context.Context) (uint, error) {
return instrument2[uint](ic.m, "eth_getBlockTransactionCountByNumber", func() (uint, error) {
return ic.c.PendingTransactionCount(ctx)
})
}
func (ic *InstrumentedClient) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) {
return instrument2[[]byte](ic.m, "eth_call", func() ([]byte, error) {
return ic.c.CallContract(ctx, msg, blockNumber)
})
}
func (ic *InstrumentedClient) CallContractAtHash(ctx context.Context, msg ethereum.CallMsg, blockHash common.Hash) ([]byte, error) {
return instrument2[[]byte](ic.m, "eth_call", func() ([]byte, error) {
return ic.c.CallContractAtHash(ctx, msg, blockHash)
})
}
func (ic *InstrumentedClient) PendingCallContract(ctx context.Context, msg ethereum.CallMsg) ([]byte, error) {
return instrument2[[]byte](ic.m, "eth_call", func() ([]byte, error) {
return ic.c.PendingCallContract(ctx, msg)
})
}
func (ic *InstrumentedClient) SuggestGasPrice(ctx context.Context) (*big.Int, error) {
return instrument2[*big.Int](ic.m, "eth_gasPrice", func() (*big.Int, error) {
return ic.c.SuggestGasPrice(ctx)
})
}
func (ic *InstrumentedClient) SuggestGasTipCap(ctx context.Context) (*big.Int, error) {
return instrument2[*big.Int](ic.m, "eth_maxPriorityFeePerGas", func() (*big.Int, error) {
return ic.c.SuggestGasPrice(ctx)
})
}
func (ic *InstrumentedClient) EstimateGas(ctx context.Context, msg ethereum.CallMsg) (uint64, error) {
return instrument2[uint64](ic.m, "eth_estimateGas", func() (uint64, error) {
return ic.c.EstimateGas(ctx, msg)
})
}
func (ic *InstrumentedClient) SendTransaction(ctx context.Context, tx *types.Transaction) error {
return instrument1(ic.m, "eth_sendRawTransaction", func() error {
return ic.c.SendTransaction(ctx, tx)
})
}
func instrument1(m *metrics.Metrics, name string, cb func() error) error {
record := m.RecordRPCClientRequest(name)
err := cb()
record(err)
return err
}
func instrument2[O any](m *metrics.Metrics, name string, cb func() (O, error)) (O, error) {
record := m.RecordRPCClientRequest(name)
res, err := cb()
record(err)
return res, err
}
package client
import (
"context"
"github.com/ethereum-optimism/optimism/op-node/metrics"
"github.com/ethereum/go-ethereum/rpc"
"github.com/prometheus/client_golang/prometheus"
)
type RPC interface {
Close()
CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error
BatchCallContext(ctx context.Context, b []rpc.BatchElem) error
EthSubscribe(ctx context.Context, channel interface{}, args ...interface{}) (*rpc.ClientSubscription, error)
}
// InstrumentedRPCClient is an RPC client that tracks
// Prometheus metrics for each call.
type InstrumentedRPCClient struct {
c *rpc.Client
m *metrics.Metrics
}
// NewInstrumentedRPC creates a new instrumented RPC client. It takes
// a concrete *rpc.Client to prevent people from passing in an already
// instrumented client.
func NewInstrumentedRPC(c *rpc.Client, m *metrics.Metrics) *InstrumentedRPCClient {
return &InstrumentedRPCClient{
c: c,
m: m,
}
}
func (ic *InstrumentedRPCClient) Close() {
ic.c.Close()
}
func (ic *InstrumentedRPCClient) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error {
return instrument1(ic.m, method, func() error {
return ic.c.CallContext(ctx, result, method, args...)
})
}
func (ic *InstrumentedRPCClient) BatchCallContext(ctx context.Context, b []rpc.BatchElem) error {
return instrumentBatch(ic.m, func() error {
return ic.c.BatchCallContext(ctx, b)
}, b)
}
func (ic *InstrumentedRPCClient) EthSubscribe(ctx context.Context, channel interface{}, args ...interface{}) (*rpc.ClientSubscription, error) {
return ic.c.EthSubscribe(ctx, channel, args...)
}
func (ic *InstrumentedRPCClient) Client() Client {
return NewInstrumentedClient(ic.c, ic.m)
}
// instrumentBatch handles metrics for batch calls. Request metrics are
// increased for each batch element. Request durations are tracked for
// the batch as a whole using a special <batch> method. Errors are tracked
// for each individual batch response, unless the overall request fails in
// which case the <batch> method is used.
func instrumentBatch(m *metrics.Metrics, cb func() error, b []rpc.BatchElem) error {
m.RPCClientRequestsTotal.WithLabelValues(metrics.BatchMethod).Inc()
for _, elem := range b {
m.RPCClientRequestsTotal.WithLabelValues(elem.Method).Inc()
}
timer := prometheus.NewTimer(m.RPCClientRequestDurationSeconds.WithLabelValues(metrics.BatchMethod))
defer timer.ObserveDuration()
// Track response times for batch requests separately.
if err := cb(); err != nil {
m.RecordRPCClientResponse(metrics.BatchMethod, err)
return err
}
for _, elem := range b {
m.RecordRPCClientResponse(elem.Method, elem.Error)
}
return nil
}
...@@ -6,6 +6,8 @@ import ( ...@@ -6,6 +6,8 @@ import (
"os/signal" "os/signal"
"syscall" "syscall"
"github.com/ethereum-optimism/optimism/op-node/metrics"
opnode "github.com/ethereum-optimism/optimism/op-node" opnode "github.com/ethereum-optimism/optimism/op-node"
"github.com/ethereum-optimism/optimism/op-node/version" "github.com/ethereum-optimism/optimism/op-node/version"
...@@ -69,6 +71,7 @@ func RollupNodeMain(ctx *cli.Context) error { ...@@ -69,6 +71,7 @@ func RollupNodeMain(ctx *cli.Context) error {
return err return err
} }
log := logCfg.NewLogger() log := logCfg.NewLogger()
m := metrics.NewMetrics("default")
cfg, err := opnode.NewConfig(ctx, log) cfg, err := opnode.NewConfig(ctx, log)
if err != nil { if err != nil {
...@@ -81,7 +84,7 @@ func RollupNodeMain(ctx *cli.Context) error { ...@@ -81,7 +84,7 @@ func RollupNodeMain(ctx *cli.Context) error {
return err return err
} }
n, err := node.New(context.Background(), cfg, log, snapshotLog, VersionWithMeta) n, err := node.New(context.Background(), cfg, log, snapshotLog, VersionWithMeta, m)
if err != nil { if err != nil {
log.Error("Unable to create the rollup node", "error", err) log.Error("Unable to create the rollup node", "error", err)
return err return err
...@@ -94,6 +97,8 @@ func RollupNodeMain(ctx *cli.Context) error { ...@@ -94,6 +97,8 @@ func RollupNodeMain(ctx *cli.Context) error {
} }
defer n.Close() defer n.Close()
m.RecordInfo(VersionWithMeta)
m.RecordUp()
log.Info("Rollup node started") log.Info("Rollup node started")
interruptChannel := make(chan os.Signal, 1) interruptChannel := make(chan os.Signal, 1)
......
...@@ -81,6 +81,23 @@ var ( ...@@ -81,6 +81,23 @@ var (
Usage: "Color the log output", Usage: "Color the log output",
EnvVar: prefixEnvVar("LOG_COLOR"), EnvVar: prefixEnvVar("LOG_COLOR"),
} }
MetricsEnabledFlag = cli.BoolFlag{
Name: "metrics.enabled",
Usage: "Enable the metrics server",
EnvVar: prefixEnvVar("METRICS_ENABLED"),
}
MetricsAddrFlag = cli.StringFlag{
Name: "metrics.addr",
Usage: "Metrics listening address",
Value: "0.0.0.0",
EnvVar: prefixEnvVar("METRICS_ADDR"),
}
MetricsPortFlag = cli.IntFlag{
Name: "metrics.port",
Usage: "Metrics listening port",
Value: 7300,
EnvVar: prefixEnvVar("METRICS_PORT"),
}
SnapshotLog = cli.StringFlag{ SnapshotLog = cli.StringFlag{
Name: "snapshotlog.file", Name: "snapshotlog.file",
...@@ -104,6 +121,9 @@ var optionalFlags = append([]cli.Flag{ ...@@ -104,6 +121,9 @@ var optionalFlags = append([]cli.Flag{
LogLevelFlag, LogLevelFlag,
LogFormatFlag, LogFormatFlag,
LogColorFlag, LogColorFlag,
MetricsEnabledFlag,
MetricsAddrFlag,
MetricsPortFlag,
SnapshotLog, SnapshotLog,
}, p2pFlags...) }, p2pFlags...)
......
...@@ -25,6 +25,7 @@ require ( ...@@ -25,6 +25,7 @@ require (
github.com/libp2p/go-tcp-transport v0.5.1 github.com/libp2p/go-tcp-transport v0.5.1
github.com/multiformats/go-multiaddr v0.5.0 github.com/multiformats/go-multiaddr v0.5.0
github.com/multiformats/go-multiaddr-dns v0.3.1 github.com/multiformats/go-multiaddr-dns v0.3.1
github.com/prometheus/client_golang v1.12.2
github.com/stretchr/testify v1.7.0 github.com/stretchr/testify v1.7.0
github.com/urfave/cli v1.22.5 github.com/urfave/cli v1.22.5
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 golang.org/x/term v0.0.0-20210927222741-03fcf44c2211
...@@ -130,9 +131,8 @@ require ( ...@@ -130,9 +131,8 @@ require (
github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pkg/errors v0.9.1 // indirect github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.11.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.30.0 // indirect github.com/prometheus/common v0.35.0 // indirect
github.com/prometheus/procfs v0.7.3 // indirect github.com/prometheus/procfs v0.7.3 // indirect
github.com/prometheus/tsdb v0.10.0 // indirect github.com/prometheus/tsdb v0.10.0 // indirect
github.com/raulk/clock v1.1.0 // indirect github.com/raulk/clock v1.1.0 // indirect
...@@ -156,14 +156,14 @@ require ( ...@@ -156,14 +156,14 @@ require (
go.uber.org/zap v1.19.1 // indirect go.uber.org/zap v1.19.1 // indirect
golang.org/x/crypto v0.0.0-20220307211146-efcb8507fb70 // indirect golang.org/x/crypto v0.0.0-20220307211146-efcb8507fb70 // indirect
golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57 // indirect golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57 // indirect
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5 // indirect golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c // indirect
golang.org/x/time v0.0.0-20220224211638-0e9765cccd65 // indirect golang.org/x/time v0.0.0-20220224211638-0e9765cccd65 // indirect
golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023 // indirect golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/grpc v1.40.0 // indirect google.golang.org/grpc v1.40.0 // indirect
google.golang.org/protobuf v1.27.1 // indirect google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/urfave/cli.v1 v1.20.0 // indirect gopkg.in/urfave/cli.v1 v1.20.0 // indirect
......
...@@ -263,10 +263,12 @@ github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2 ...@@ -263,10 +263,12 @@ github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2
github.com/go-kit/kit v0.10.0 h1:dXFJfIHVvUcpSgDOV+Ne6t7jXri8Tfv2uOLHUZ2XNuo= github.com/go-kit/kit v0.10.0 h1:dXFJfIHVvUcpSgDOV+Ne6t7jXri8Tfv2uOLHUZ2XNuo=
github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o=
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-logfmt/logfmt v0.5.0 h1:TrB8swr/68K7m9CcGut2g3UOihhbcbiMAYiuTXdEih4=
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA=
github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
...@@ -493,6 +495,7 @@ github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u ...@@ -493,6 +495,7 @@ github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u
github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/jsternberg/zap-logfmt v1.0.0/go.mod h1:uvPs/4X51zdkcm5jXl5SYoN+4RK21K8mysFmDaM/h+o= github.com/jsternberg/zap-logfmt v1.0.0/go.mod h1:uvPs/4X51zdkcm5jXl5SYoN+4RK21K8mysFmDaM/h+o=
...@@ -751,6 +754,7 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ ...@@ -751,6 +754,7 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8=
github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8=
github.com/mr-tron/base58 v1.1.2/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mr-tron/base58 v1.1.2/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc=
...@@ -883,8 +887,10 @@ github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeD ...@@ -883,8 +887,10 @@ github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeD
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU=
github.com/prometheus/client_golang v1.10.0/go.mod h1:WJM3cc3yu7XKBKa/I8WeZm+V3eltZnBwfENSU7mdogU= github.com/prometheus/client_golang v1.10.0/go.mod h1:WJM3cc3yu7XKBKa/I8WeZm+V3eltZnBwfENSU7mdogU=
github.com/prometheus/client_golang v1.11.0 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ=
github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0=
github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY=
github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34=
github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
...@@ -901,8 +907,10 @@ github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB8 ...@@ -901,8 +907,10 @@ github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB8
github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s=
github.com/prometheus/common v0.18.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.18.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s=
github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
github.com/prometheus/common v0.30.0 h1:JEkYlQnpzrzQFxi6gnukFPdQ+ac82oRhzMcIduJu/Ug=
github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
github.com/prometheus/common v0.35.0 h1:Eyr+Pw2VymWejHqCugNaQXkAi6KayVNxaHeu6khmFBE=
github.com/prometheus/common v0.35.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA=
github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
...@@ -1216,8 +1224,10 @@ golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qx ...@@ -1216,8 +1224,10 @@ golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qx
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 h1:CIJ76btIcR3eFI5EgSo6k1qKw9KJexJuRLI9G7Hp5wE=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc=
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
...@@ -1226,6 +1236,7 @@ golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4Iltr ...@@ -1226,6 +1236,7 @@ golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4Iltr
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
...@@ -1324,10 +1335,12 @@ golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBc ...@@ -1324,10 +1335,12 @@ golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5 h1:y/woIyUBFbpQGKS0u1aHF/40WUDnek3fPOyD08H5Vng=
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c h1:aFV+BgZ4svzjfabn8ERpuB4JI4N6/rdy1iusx77G3oU=
golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY=
...@@ -1525,8 +1538,9 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj ...@@ -1525,8 +1538,9 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ=
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
......
...@@ -4,17 +4,19 @@ import ( ...@@ -4,17 +4,19 @@ import (
"context" "context"
"sync" "sync"
"github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/rpc"
) )
type limitClient struct { type limitClient struct {
c RPCClient c client.RPC
sema chan struct{} sema chan struct{}
wg sync.WaitGroup wg sync.WaitGroup
} }
// LimitRPC limits concurrent RPC requests (excluding subscriptions) to a given number by wrapping the client with a semaphore. // LimitRPC limits concurrent RPC requests (excluding subscriptions) to a given number by wrapping the client with a semaphore.
func LimitRPC(c RPCClient, concurrentRequests int) RPCClient { func LimitRPC(c client.RPC, concurrentRequests int) client.RPC {
return &limitClient{ return &limitClient{
c: c, c: c,
// the capacity of the channel determines how many go-routines can concurrently execute requests with the wrapped client. // the capacity of the channel determines how many go-routines can concurrently execute requests with the wrapped client.
......
...@@ -5,6 +5,7 @@ import ( ...@@ -5,6 +5,7 @@ import (
"errors" "errors"
"fmt" "fmt"
"github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
...@@ -94,17 +95,10 @@ func DefaultConfig(config *rollup.Config, trustRPC bool) *SourceConfig { ...@@ -94,17 +95,10 @@ func DefaultConfig(config *rollup.Config, trustRPC bool) *SourceConfig {
type batchCallContextFn func(ctx context.Context, b []rpc.BatchElem) error type batchCallContextFn func(ctx context.Context, b []rpc.BatchElem) error
type RPCClient interface {
BatchCallContext(ctx context.Context, b []rpc.BatchElem) error
CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error
EthSubscribe(ctx context.Context, channel interface{}, args ...interface{}) (*rpc.ClientSubscription, error)
Close()
}
// Source to retrieve L1 data from with optimized batch requests, cached results, // Source to retrieve L1 data from with optimized batch requests, cached results,
// and flag to not trust the RPC. // and flag to not trust the RPC.
type Source struct { type Source struct {
client RPCClient client client.RPC
batchCall batchCallContextFn batchCall batchCallContextFn
...@@ -123,7 +117,7 @@ type Source struct { ...@@ -123,7 +117,7 @@ type Source struct {
headersCache *lru.Cache headersCache *lru.Cache
} }
func NewSource(client RPCClient, log log.Logger, config *SourceConfig) (*Source, error) { func NewSource(client client.RPC, log log.Logger, config *SourceConfig) (*Source, error) {
if err := config.Check(); err != nil { if err := config.Check(); err != nil {
return nil, fmt.Errorf("bad config, cannot create L1 source: %w", err) return nil, fmt.Errorf("bad config, cannot create L1 source: %w", err)
} }
......
...@@ -6,10 +6,10 @@ import ( ...@@ -6,10 +6,10 @@ import (
"math/rand" "math/rand"
"testing" "testing"
"github.com/ethereum-optimism/optimism/op-node/testlog" "github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
...@@ -45,7 +45,7 @@ func (m *mockRPC) Close() { ...@@ -45,7 +45,7 @@ func (m *mockRPC) Close() {
m.MethodCalled("Close") m.MethodCalled("Close")
} }
var _ RPCClient = (*mockRPC)(nil) var _ client.RPC = (*mockRPC)(nil)
func randHash() (out common.Hash) { func randHash() (out common.Hash) {
rand.Read(out[:]) rand.Read(out[:])
......
...@@ -6,6 +6,8 @@ import ( ...@@ -6,6 +6,8 @@ import (
"math/big" "math/big"
"time" "time"
"github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum"
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
...@@ -13,22 +15,21 @@ import ( ...@@ -13,22 +15,21 @@ import (
"github.com/ethereum-optimism/optimism/op-node/rollup/derive" "github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/rpc"
) )
type Source struct { type Source struct {
rpc *rpc.Client // raw RPC client. Used for the consensus namespace rpc client.RPC // raw RPC client. Used for the consensus namespace
client *ethclient.Client // go-ethereum's wrapper around the rpc client for the eth namespace client client.Client // go-ethereum's wrapper around the rpc client for the eth namespace
genesis *rollup.Genesis genesis *rollup.Genesis
log log.Logger log log.Logger
} }
func NewSource(l2Node *rpc.Client, genesis *rollup.Genesis, log log.Logger) (*Source, error) { func NewSource(l2Node client.RPC, l2Client client.Client, genesis *rollup.Genesis, log log.Logger) (*Source, error) {
return &Source{ return &Source{
rpc: l2Node, rpc: l2Node,
client: ethclient.NewClient(l2Node), client: l2Client,
genesis: genesis, genesis: genesis,
log: log, log: log,
}, nil }, nil
...@@ -218,16 +219,16 @@ func blockToBlockRef(block *types.Block, genesis *rollup.Genesis) (eth.L2BlockRe ...@@ -218,16 +219,16 @@ func blockToBlockRef(block *types.Block, genesis *rollup.Genesis) (eth.L2BlockRe
} }
type ReadOnlySource struct { type ReadOnlySource struct {
rpc *rpc.Client // raw RPC client. Used for methods that do not already have bindings rpc client.RPC // raw RPC client. Used for methods that do not already have bindings
client *ethclient.Client // go-ethereum's wrapper around the rpc client for the eth namespace client client.Client // go-ethereum's wrapper around the rpc client for the eth namespace
genesis *rollup.Genesis genesis *rollup.Genesis
log log.Logger log log.Logger
} }
func NewReadOnlySource(l2Node *rpc.Client, genesis *rollup.Genesis, log log.Logger) (*ReadOnlySource, error) { func NewReadOnlySource(l2Node client.RPC, l2Client client.Client, genesis *rollup.Genesis, log log.Logger) (*ReadOnlySource, error) {
return &ReadOnlySource{ return &ReadOnlySource{
rpc: l2Node, rpc: l2Node,
client: ethclient.NewClient(l2Node), client: l2Client,
genesis: genesis, genesis: genesis,
log: log, log: log,
}, nil }, nil
......
package metrics
import (
"context"
"errors"
"fmt"
"net"
"net/http"
"strconv"
"github.com/ethereum/go-ethereum"
"github.com/prometheus/client_golang/prometheus/collectors"
"github.com/ethereum/go-ethereum/rpc"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
const (
Namespace = "op_node"
RPCServerSubsystem = "rpc_server"
RPCClientSubsystem = "rpc_client"
BatchMethod = "<batch>"
)
type Metrics struct {
Info *prometheus.GaugeVec
Up prometheus.Gauge
RPCServerRequestsTotal *prometheus.CounterVec
RPCServerRequestDurationSeconds *prometheus.HistogramVec
RPCClientRequestsTotal *prometheus.CounterVec
RPCClientRequestDurationSeconds *prometheus.HistogramVec
RPCClientResponsesTotal *prometheus.CounterVec
registry *prometheus.Registry
}
func NewMetrics(procName string) *Metrics {
if procName == "" {
procName = "default"
}
ns := Namespace + "_" + procName
registry := prometheus.NewRegistry()
registry.MustRegister(collectors.NewProcessCollector(collectors.ProcessCollectorOpts{}))
registry.MustRegister(collectors.NewGoCollector())
return &Metrics{
Info: promauto.With(registry).NewGaugeVec(prometheus.GaugeOpts{
Namespace: ns,
Name: "info",
Help: "Pseudo-metric tracking version and config info",
}, []string{
"version",
}),
Up: promauto.With(registry).NewGauge(prometheus.GaugeOpts{
Namespace: ns,
Name: "up",
Help: "1 if the op node has finished starting up",
}),
RPCServerRequestsTotal: promauto.With(registry).NewCounterVec(prometheus.CounterOpts{
Namespace: ns,
Subsystem: RPCServerSubsystem,
Name: "requests_total",
Help: "Total requests to the RPC server",
}, []string{
"method",
}),
RPCServerRequestDurationSeconds: promauto.With(registry).NewHistogramVec(prometheus.HistogramOpts{
Namespace: ns,
Subsystem: RPCServerSubsystem,
Name: "request_duration_seconds",
Buckets: []float64{.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10},
Help: "Histogram of RPC server request durations",
}, []string{
"method",
}),
RPCClientRequestsTotal: promauto.With(registry).NewCounterVec(prometheus.CounterOpts{
Namespace: ns,
Subsystem: RPCClientSubsystem,
Name: "requests_total",
Help: "Total RPC requests initiated by the opnode's RPC client",
}, []string{
"method",
}),
RPCClientRequestDurationSeconds: promauto.With(registry).NewHistogramVec(prometheus.HistogramOpts{
Namespace: ns,
Subsystem: RPCClientSubsystem,
Name: "request_duration_seconds",
Buckets: []float64{.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10},
Help: "Histogram of RPC client request durations",
}, []string{
"method",
}),
RPCClientResponsesTotal: promauto.With(registry).NewCounterVec(prometheus.CounterOpts{
Namespace: ns,
Subsystem: RPCClientSubsystem,
Name: "responses_total",
Help: "Total RPC request responses received by the opnode's RPC client",
}, []string{
"method",
"error",
}),
registry: registry,
}
}
// RecordInfo sets a pseudo-metric that contains versioning and
// config info for the opnode.
func (m *Metrics) RecordInfo(version string) {
m.Info.WithLabelValues(version).Set(1)
}
// RecordUp sets the up metric to 1.
func (m *Metrics) RecordUp() {
prometheus.MustRegister()
m.Up.Set(1)
}
// RecordRPCServerRequest is a helper method to record an incoming RPC
// call to the opnode's RPC server. It bumps the requests metric,
// and tracks how long it takes to serve a response.
func (m *Metrics) RecordRPCServerRequest(method string) func() {
m.RPCServerRequestsTotal.WithLabelValues(method).Inc()
timer := prometheus.NewTimer(m.RPCServerRequestDurationSeconds.WithLabelValues(method))
return func() {
timer.ObserveDuration()
}
}
// RecordRPCClientRequest is a helper method to record an RPC client
// request. It bumps the requests metric, tracks the response
// duration, and records the response's error code.
func (m *Metrics) RecordRPCClientRequest(method string) func(err error) {
m.RPCClientRequestsTotal.WithLabelValues(method).Inc()
timer := prometheus.NewTimer(m.RPCClientRequestDurationSeconds.WithLabelValues(method))
return func(err error) {
m.RecordRPCClientResponse(method, err)
timer.ObserveDuration()
}
}
// RecordRPCClientResponse records an RPC response. It will
// convert the passed-in error into something metrics friendly.
// Nil errors get converted into <nil>, RPC errors are converted
// into rpc_<error code>, HTTP errors are converted into
// http_<status code>, and everything else is converted into
// <unknown>.
func (m *Metrics) RecordRPCClientResponse(method string, err error) {
var errStr string
var rpcErr rpc.Error
var httpErr rpc.HTTPError
if err == nil {
errStr = "<nil>"
} else if errors.As(err, &rpcErr) {
errStr = fmt.Sprintf("rpc_%d", rpcErr.ErrorCode())
} else if errors.As(err, &httpErr) {
errStr = fmt.Sprintf("http_%d", httpErr.StatusCode)
} else if errors.Is(err, ethereum.NotFound) {
errStr = "<not found>"
} else {
errStr = "<unknown>"
}
m.RPCClientResponsesTotal.WithLabelValues(method, errStr).Inc()
}
// Serve starts the metrics server on the given hostname and port.
// The server will be closed when the passed-in context is cancelled.
func (m *Metrics) Serve(ctx context.Context, hostname string, port int) error {
addr := net.JoinHostPort(hostname, strconv.Itoa(port))
server := &http.Server{
Addr: addr,
Handler: promhttp.InstrumentMetricHandler(
m.registry, promhttp.HandlerFor(m.registry, promhttp.HandlerOpts{}),
),
}
go func() {
<-ctx.Done()
server.Close()
}()
return server.ListenAndServe()
}
...@@ -7,6 +7,8 @@ import ( ...@@ -7,6 +7,8 @@ import (
"fmt" "fmt"
"math/big" "math/big"
"github.com/ethereum-optimism/optimism/op-node/metrics"
"github.com/ethereum-optimism/optimism/op-node/version" "github.com/ethereum-optimism/optimism/op-node/version"
"github.com/ethereum-optimism/optimism/op-bindings/predeploys" "github.com/ethereum-optimism/optimism/op-bindings/predeploys"
...@@ -40,17 +42,21 @@ type nodeAPI struct { ...@@ -40,17 +42,21 @@ type nodeAPI struct {
config *rollup.Config config *rollup.Config
client l2EthClient client l2EthClient
log log.Logger log log.Logger
m *metrics.Metrics
} }
func newNodeAPI(config *rollup.Config, l2Client l2EthClient, log log.Logger) *nodeAPI { func newNodeAPI(config *rollup.Config, l2Client l2EthClient, log log.Logger, m *metrics.Metrics) *nodeAPI {
return &nodeAPI{ return &nodeAPI{
config: config, config: config,
client: l2Client, client: l2Client,
log: log, log: log,
m: m,
} }
} }
func (n *nodeAPI) OutputAtBlock(ctx context.Context, number rpc.BlockNumber) ([]eth.Bytes32, error) { func (n *nodeAPI) OutputAtBlock(ctx context.Context, number rpc.BlockNumber) ([]eth.Bytes32, error) {
recordDur := n.m.RecordRPCServerRequest("optimism_outputAtBlock")
defer recordDur()
// TODO: rpc.BlockNumber doesn't support the "safe" tag. Need a new type // TODO: rpc.BlockNumber doesn't support the "safe" tag. Need a new type
head, err := n.client.GetBlockHeader(ctx, toBlockNumArg(number)) head, err := n.client.GetBlockHeader(ctx, toBlockNumArg(number))
...@@ -83,6 +89,8 @@ func (n *nodeAPI) OutputAtBlock(ctx context.Context, number rpc.BlockNumber) ([] ...@@ -83,6 +89,8 @@ func (n *nodeAPI) OutputAtBlock(ctx context.Context, number rpc.BlockNumber) ([]
} }
func (n *nodeAPI) Version(ctx context.Context) (string, error) { func (n *nodeAPI) Version(ctx context.Context) (string, error) {
recordDur := n.m.RecordRPCServerRequest("optimism_version")
defer recordDur()
return version.Version + "-" + version.Meta, nil return version.Version + "-" + version.Meta, nil
} }
......
package node package node
import ( import (
"errors"
"fmt" "fmt"
"math"
"github.com/ethereum-optimism/optimism/op-node/p2p" "github.com/ethereum-optimism/optimism/op-node/p2p"
...@@ -25,6 +27,8 @@ type Config struct { ...@@ -25,6 +27,8 @@ type Config struct {
P2P p2p.SetupP2P P2P p2p.SetupP2P
Metrics MetricsConfig
// Optional // Optional
Tracer Tracer Tracer Tracer
} }
...@@ -34,17 +38,38 @@ type RPCConfig struct { ...@@ -34,17 +38,38 @@ type RPCConfig struct {
ListenPort int ListenPort int
} }
type MetricsConfig struct {
Enabled bool
ListenAddr string
ListenPort int
}
func (m MetricsConfig) Check() error {
if !m.Enabled {
return nil
}
if m.ListenPort < 0 || m.ListenPort > math.MaxUint16 {
return errors.New("invalid metrics port")
}
return nil
}
// Check verifies that the given configuration makes sense // Check verifies that the given configuration makes sense
func (cfg *Config) Check() error { func (cfg *Config) Check() error {
if err := cfg.L2.Check(); err != nil { if err := cfg.L2.Check(); err != nil {
return fmt.Errorf("l2 endpoint config error: %v", err) return fmt.Errorf("l2 endpoint config error: %w", err)
} }
if err := cfg.Rollup.Check(); err != nil { if err := cfg.Rollup.Check(); err != nil {
return fmt.Errorf("rollup config error: %v", err) return fmt.Errorf("rollup config error: %w", err)
}
if err := cfg.Metrics.Check(); err != nil {
return fmt.Errorf("metrics config error: %w", err)
} }
if cfg.P2P != nil { if cfg.P2P != nil {
if err := cfg.P2P.Check(); err != nil { if err := cfg.P2P.Check(); err != nil {
return fmt.Errorf("p2p config error: %v", err) return fmt.Errorf("p2p config error: %w", err)
} }
} }
return nil return nil
......
...@@ -7,28 +7,30 @@ import ( ...@@ -7,28 +7,30 @@ import (
"github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-libp2p-core/peer"
"github.com/ethereum-optimism/optimism/op-node/p2p" "github.com/hashicorp/go-multierror"
multierror "github.com/hashicorp/go-multierror"
"github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/l1" "github.com/ethereum-optimism/optimism/op-node/l1"
"github.com/ethereum-optimism/optimism/op-node/l2" "github.com/ethereum-optimism/optimism/op-node/l2"
"github.com/ethereum-optimism/optimism/op-node/metrics"
"github.com/ethereum-optimism/optimism/op-node/p2p"
"github.com/ethereum-optimism/optimism/op-node/rollup/driver" "github.com/ethereum-optimism/optimism/op-node/rollup/driver"
"github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/rpc"
) )
type OpNode struct { type OpNode struct {
log log.Logger log log.Logger
appVersion string appVersion string
metrics *metrics.Metrics
l1HeadsSub ethereum.Subscription // Subscription to get L1 heads (automatically re-subscribes on error) l1HeadsSub ethereum.Subscription // Subscription to get L1 heads (automatically re-subscribes on error)
l1Source *l1.Source // Source to fetch data from (also implements the Downloader interface) l1Source *l1.Source // Source to fetch data from (also implements the Downloader interface)
l2Engine *driver.Driver // L2 Engine to Sync l2Engine *driver.Driver // L2 Engine to Sync
l2Node *rpc.Client // L2 Execution Engine RPC connections to close at shutdown l2Node client.RPC // L2 Execution Engine RPC connections to close at shutdown
l2Client client.Client // L2 client wrapper around eth namespace
server *rpcServer // RPC server hosting the rollup-node API server *rpcServer // RPC server hosting the rollup-node API
p2pNode *p2p.NodeP2P // P2P node functionality p2pNode *p2p.NodeP2P // P2P node functionality
p2pSigner p2p.Signer // p2p gogssip application messages will be signed with this signer p2pSigner p2p.Signer // p2p gogssip application messages will be signed with this signer
...@@ -43,7 +45,7 @@ type OpNode struct { ...@@ -43,7 +45,7 @@ type OpNode struct {
// The OpNode handles incoming gossip // The OpNode handles incoming gossip
var _ p2p.GossipIn = (*OpNode)(nil) var _ p2p.GossipIn = (*OpNode)(nil)
func New(ctx context.Context, cfg *Config, log log.Logger, snapshotLog log.Logger, appVersion string) (*OpNode, error) { func New(ctx context.Context, cfg *Config, log log.Logger, snapshotLog log.Logger, appVersion string, m *metrics.Metrics) (*OpNode, error) {
if err := cfg.Check(); err != nil { if err := cfg.Check(); err != nil {
return nil, err return nil, err
} }
...@@ -51,6 +53,7 @@ func New(ctx context.Context, cfg *Config, log log.Logger, snapshotLog log.Logge ...@@ -51,6 +53,7 @@ func New(ctx context.Context, cfg *Config, log log.Logger, snapshotLog log.Logge
n := &OpNode{ n := &OpNode{
log: log, log: log,
appVersion: appVersion, appVersion: appVersion,
metrics: m,
} }
// not a context leak, gossipsub is closed with a context. // not a context leak, gossipsub is closed with a context.
n.resourcesCtx, n.resourcesClose = context.WithCancel(context.Background()) n.resourcesCtx, n.resourcesClose = context.WithCancel(context.Background())
...@@ -86,6 +89,9 @@ func (n *OpNode) init(ctx context.Context, cfg *Config, snapshotLog log.Logger) ...@@ -86,6 +89,9 @@ func (n *OpNode) init(ctx context.Context, cfg *Config, snapshotLog log.Logger)
if err := n.initRPCServer(ctx, cfg); err != nil { if err := n.initRPCServer(ctx, cfg); err != nil {
return err return err
} }
if err := n.initMetricsServer(ctx, cfg); err != nil {
return err
}
return nil return nil
} }
...@@ -104,7 +110,7 @@ func (n *OpNode) initL1(ctx context.Context, cfg *Config) error { ...@@ -104,7 +110,7 @@ func (n *OpNode) initL1(ctx context.Context, cfg *Config) error {
return fmt.Errorf("failed to get L1 RPC client: %w", err) return fmt.Errorf("failed to get L1 RPC client: %w", err)
} }
n.l1Source, err = l1.NewSource(l1Node, n.log, l1.DefaultConfig(&cfg.Rollup, trustRPC)) n.l1Source, err = l1.NewSource(client.NewInstrumentedRPC(l1Node, n.metrics), n.log, l1.DefaultConfig(&cfg.Rollup, trustRPC))
if err != nil { if err != nil {
return fmt.Errorf("failed to create L1 source: %v", err) return fmt.Errorf("failed to create L1 source: %v", err)
} }
...@@ -131,30 +137,31 @@ func (n *OpNode) initL2(ctx context.Context, cfg *Config, snapshotLog log.Logger ...@@ -131,30 +137,31 @@ func (n *OpNode) initL2(ctx context.Context, cfg *Config, snapshotLog log.Logger
if err != nil { if err != nil {
return fmt.Errorf("failed to setup L2 execution-engine RPC client: %w", err) return fmt.Errorf("failed to setup L2 execution-engine RPC client: %w", err)
} }
n.l2Node = rpcClient n.l2Node = client.NewInstrumentedRPC(rpcClient, n.metrics)
client, err := l2.NewSource(rpcClient, &cfg.Rollup.Genesis, n.log) n.l2Client = client.NewInstrumentedClient(rpcClient, n.metrics)
source, err := l2.NewSource(n.l2Node, n.l2Client, &cfg.Rollup.Genesis, n.log)
if err != nil { if err != nil {
return err return err
} }
snap := snapshotLog.New() snap := snapshotLog.New()
n.l2Engine = driver.NewDriver(cfg.Rollup, client, n.l1Source, n, n.log, snap, cfg.Sequencer) n.l2Engine = driver.NewDriver(cfg.Rollup, source, n.l1Source, n, n.log, snap, cfg.Sequencer)
return nil return nil
} }
func (n *OpNode) initRPCServer(ctx context.Context, cfg *Config) error { func (n *OpNode) initRPCServer(ctx context.Context, cfg *Config) error {
// TODO: attach the p2p node ID to the snapshot logger // TODO: attach the p2p node ID to the snapshot logger
client, err := l2.NewReadOnlySource(n.l2Node, &cfg.Rollup.Genesis, n.log) client, err := l2.NewReadOnlySource(n.l2Node, n.l2Client, &cfg.Rollup.Genesis, n.log)
if err != nil { if err != nil {
return err return err
} }
n.server, err = newRPCServer(ctx, &cfg.RPC, &cfg.Rollup, client, n.log, n.appVersion) n.server, err = newRPCServer(ctx, &cfg.RPC, &cfg.Rollup, client, n.log, n.appVersion, n.metrics)
if err != nil { if err != nil {
return err return err
} }
if n.p2pNode != nil { if n.p2pNode != nil {
n.server.EnableP2P(p2p.NewP2PAPIBackend(n.p2pNode, n.log)) n.server.EnableP2P(p2p.NewP2PAPIBackend(n.p2pNode, n.log, n.metrics))
} }
n.log.Info("Starting JSON-RPC server") n.log.Info("Starting JSON-RPC server")
if err := n.server.Start(); err != nil { if err := n.server.Start(); err != nil {
...@@ -163,6 +170,20 @@ func (n *OpNode) initRPCServer(ctx context.Context, cfg *Config) error { ...@@ -163,6 +170,20 @@ func (n *OpNode) initRPCServer(ctx context.Context, cfg *Config) error {
return nil return nil
} }
func (n *OpNode) initMetricsServer(ctx context.Context, cfg *Config) error {
if !cfg.Metrics.Enabled {
n.log.Info("metrics disabled")
return nil
}
n.log.Info("starting metrics server", "addr", cfg.Metrics.ListenAddr, "port", cfg.Metrics.ListenPort)
go func() {
if err := n.metrics.Serve(ctx, cfg.Metrics.ListenAddr, cfg.Metrics.ListenPort); err != nil {
log.Crit("error starting metrics server", "err", err)
}
}()
return nil
}
func (n *OpNode) initP2P(ctx context.Context, cfg *Config) error { func (n *OpNode) initP2P(ctx context.Context, cfg *Config) error {
if cfg.P2P != nil { if cfg.P2P != nil {
p2pNode, err := p2p.NewNodeP2P(n.resourcesCtx, &cfg.Rollup, n.log, cfg.P2P, n) p2pNode, err := p2p.NewNodeP2P(n.resourcesCtx, &cfg.Rollup, n.log, cfg.P2P, n)
......
...@@ -7,6 +7,8 @@ import ( ...@@ -7,6 +7,8 @@ import (
"net/http" "net/http"
"strconv" "strconv"
"github.com/ethereum-optimism/optimism/op-node/metrics"
"github.com/ethereum-optimism/optimism/op-node/p2p" "github.com/ethereum-optimism/optimism/op-node/p2p"
"github.com/ethereum-optimism/optimism/op-node/l2" "github.com/ethereum-optimism/optimism/op-node/l2"
...@@ -29,8 +31,8 @@ type rpcServer struct { ...@@ -29,8 +31,8 @@ type rpcServer struct {
l2.Source l2.Source
} }
func newRPCServer(ctx context.Context, rpcCfg *RPCConfig, rollupCfg *rollup.Config, l2Client l2EthClient, log log.Logger, appVersion string) (*rpcServer, error) { func newRPCServer(ctx context.Context, rpcCfg *RPCConfig, rollupCfg *rollup.Config, l2Client l2EthClient, log log.Logger, appVersion string, m *metrics.Metrics) (*rpcServer, error) {
api := newNodeAPI(rollupCfg, l2Client, log.New("rpc", "node")) api := newNodeAPI(rollupCfg, l2Client, log.New("rpc", "node"), m)
// TODO: extend RPC config with options for WS, IPC and HTTP RPC connections // TODO: extend RPC config with options for WS, IPC and HTTP RPC connections
endpoint := net.JoinHostPort(rpcCfg.ListenAddr, strconv.Itoa(rpcCfg.ListenPort)) endpoint := net.JoinHostPort(rpcCfg.ListenAddr, strconv.Itoa(rpcCfg.ListenPort))
r := &rpcServer{ r := &rpcServer{
......
...@@ -5,6 +5,8 @@ import ( ...@@ -5,6 +5,8 @@ import (
"encoding/json" "encoding/json"
"math/big" "math/big"
"github.com/ethereum-optimism/optimism/op-node/metrics"
"github.com/ethereum-optimism/optimism/op-node/version" "github.com/ethereum-optimism/optimism/op-node/version"
"testing" "testing"
...@@ -86,7 +88,7 @@ func TestOutputAtBlock(t *testing.T) { ...@@ -86,7 +88,7 @@ func TestOutputAtBlock(t *testing.T) {
l2Client.mock.On("GetBlockHeader", "latest").Return(&header) l2Client.mock.On("GetBlockHeader", "latest").Return(&header)
l2Client.mock.On("GetProof", predeploys.L2ToL1MessagePasserAddr, "latest").Return(&result) l2Client.mock.On("GetProof", predeploys.L2ToL1MessagePasserAddr, "latest").Return(&result)
server, err := newRPCServer(context.Background(), rpcCfg, rollupCfg, l2Client, log, "0.0") server, err := newRPCServer(context.Background(), rpcCfg, rollupCfg, l2Client, log, "0.0", metrics.NewMetrics(""))
assert.NoError(t, err) assert.NoError(t, err)
assert.NoError(t, server.Start()) assert.NoError(t, server.Start())
defer server.Stop() defer server.Stop()
...@@ -111,7 +113,7 @@ func TestVersion(t *testing.T) { ...@@ -111,7 +113,7 @@ func TestVersion(t *testing.T) {
rollupCfg := &rollup.Config{ rollupCfg := &rollup.Config{
// ignore other rollup config info in this test // ignore other rollup config info in this test
} }
server, err := newRPCServer(context.Background(), rpcCfg, rollupCfg, l2Client, log, "0.0") server, err := newRPCServer(context.Background(), rpcCfg, rollupCfg, l2Client, log, "0.0", metrics.NewMetrics(""))
assert.NoError(t, err) assert.NoError(t, err)
assert.NoError(t, server.Start()) assert.NoError(t, server.Start())
defer server.Stop() defer server.Stop()
......
...@@ -9,6 +9,8 @@ import ( ...@@ -9,6 +9,8 @@ import (
"testing" "testing"
"time" "time"
"github.com/ethereum-optimism/optimism/op-node/metrics"
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
...@@ -143,7 +145,7 @@ func TestP2PFull(t *testing.T) { ...@@ -143,7 +145,7 @@ func TestP2PFull(t *testing.T) {
conns <- conn conns <- conn
}}) }})
backend := NewP2PAPIBackend(nodeA, logA) backend := NewP2PAPIBackend(nodeA, logA, metrics.NewMetrics(""))
srv := rpc.NewServer() srv := rpc.NewServer()
require.NoError(t, srv.RegisterName("opp2p", backend)) require.NoError(t, srv.RegisterName("opp2p", backend))
client := rpc.DialInProc(srv) client := rpc.DialInProc(srv)
......
...@@ -8,6 +8,8 @@ import ( ...@@ -8,6 +8,8 @@ import (
"net" "net"
"time" "time"
"github.com/ethereum-optimism/optimism/op-node/metrics"
gcrypto "github.com/ethereum/go-ethereum/crypto" gcrypto "github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/p2p/discover" "github.com/ethereum/go-ethereum/p2p/discover"
...@@ -52,18 +54,22 @@ type Node interface { ...@@ -52,18 +54,22 @@ type Node interface {
type APIBackend struct { type APIBackend struct {
node Node node Node
log log.Logger log log.Logger
m *metrics.Metrics
} }
var _ API = (*APIBackend)(nil) var _ API = (*APIBackend)(nil)
func NewP2PAPIBackend(node Node, log log.Logger) *APIBackend { func NewP2PAPIBackend(node Node, log log.Logger, m *metrics.Metrics) *APIBackend {
return &APIBackend{ return &APIBackend{
node: node, node: node,
log: log, log: log,
m: m,
} }
} }
func (s *APIBackend) Self(ctx context.Context) (*PeerInfo, error) { func (s *APIBackend) Self(ctx context.Context) (*PeerInfo, error) {
recordDur := s.m.RecordRPCServerRequest("opp2p_self")
defer recordDur()
h := s.node.Host() h := s.node.Host()
nw := h.Network() nw := h.Network()
pstore := h.Peerstore() pstore := h.Peerstore()
...@@ -147,6 +153,8 @@ func dumpPeer(id peer.ID, nw network.Network, pstore peerstore.Peerstore, connMg ...@@ -147,6 +153,8 @@ func dumpPeer(id peer.ID, nw network.Network, pstore peerstore.Peerstore, connMg
// Peers lists information of peers. Optionally filter to only retrieve connected peers. // Peers lists information of peers. Optionally filter to only retrieve connected peers.
func (s *APIBackend) Peers(ctx context.Context, connected bool) (*PeerDump, error) { func (s *APIBackend) Peers(ctx context.Context, connected bool) (*PeerDump, error) {
recordDur := s.m.RecordRPCServerRequest("opp2p_peers")
defer recordDur()
h := s.node.Host() h := s.node.Host()
nw := h.Network() nw := h.Network()
pstore := h.Peerstore() pstore := h.Peerstore()
...@@ -193,6 +201,8 @@ type PeerStats struct { ...@@ -193,6 +201,8 @@ type PeerStats struct {
} }
func (s *APIBackend) PeerStats(_ context.Context) (*PeerStats, error) { func (s *APIBackend) PeerStats(_ context.Context) (*PeerStats, error) {
recordDur := s.m.RecordRPCServerRequest("opp2p_peerStats")
defer recordDur()
h := s.node.Host() h := s.node.Host()
nw := h.Network() nw := h.Network()
pstore := h.Peerstore() pstore := h.Peerstore()
...@@ -214,6 +224,8 @@ func (s *APIBackend) PeerStats(_ context.Context) (*PeerStats, error) { ...@@ -214,6 +224,8 @@ func (s *APIBackend) PeerStats(_ context.Context) (*PeerStats, error) {
} }
func (s *APIBackend) DiscoveryTable(_ context.Context) ([]*enode.Node, error) { func (s *APIBackend) DiscoveryTable(_ context.Context) ([]*enode.Node, error) {
recordDur := s.m.RecordRPCServerRequest("opp2p_discoveryTable")
defer recordDur()
if dv5 := s.node.Dv5Udp(); dv5 != nil { if dv5 := s.node.Dv5Udp(); dv5 != nil {
return dv5.AllNodes(), nil return dv5.AllNodes(), nil
} else { } else {
...@@ -222,6 +234,8 @@ func (s *APIBackend) DiscoveryTable(_ context.Context) ([]*enode.Node, error) { ...@@ -222,6 +234,8 @@ func (s *APIBackend) DiscoveryTable(_ context.Context) ([]*enode.Node, error) {
} }
func (s *APIBackend) BlockPeer(_ context.Context, p peer.ID) error { func (s *APIBackend) BlockPeer(_ context.Context, p peer.ID) error {
recordDur := s.m.RecordRPCServerRequest("opp2p_blockPeer")
defer recordDur()
if gater := s.node.ConnectionGater(); gater == nil { if gater := s.node.ConnectionGater(); gater == nil {
return NoConnectionGater return NoConnectionGater
} else { } else {
...@@ -230,6 +244,8 @@ func (s *APIBackend) BlockPeer(_ context.Context, p peer.ID) error { ...@@ -230,6 +244,8 @@ func (s *APIBackend) BlockPeer(_ context.Context, p peer.ID) error {
} }
func (s *APIBackend) UnblockPeer(_ context.Context, p peer.ID) error { func (s *APIBackend) UnblockPeer(_ context.Context, p peer.ID) error {
recordDur := s.m.RecordRPCServerRequest("opp2p_unblockPeer")
defer recordDur()
if gater := s.node.ConnectionGater(); gater == nil { if gater := s.node.ConnectionGater(); gater == nil {
return NoConnectionGater return NoConnectionGater
} else { } else {
...@@ -238,6 +254,8 @@ func (s *APIBackend) UnblockPeer(_ context.Context, p peer.ID) error { ...@@ -238,6 +254,8 @@ func (s *APIBackend) UnblockPeer(_ context.Context, p peer.ID) error {
} }
func (s *APIBackend) ListBlockedPeers(_ context.Context) ([]peer.ID, error) { func (s *APIBackend) ListBlockedPeers(_ context.Context) ([]peer.ID, error) {
recordDur := s.m.RecordRPCServerRequest("opp2p_listBlockedPeers")
defer recordDur()
if gater := s.node.ConnectionGater(); gater == nil { if gater := s.node.ConnectionGater(); gater == nil {
return nil, NoConnectionGater return nil, NoConnectionGater
} else { } else {
...@@ -248,6 +266,8 @@ func (s *APIBackend) ListBlockedPeers(_ context.Context) ([]peer.ID, error) { ...@@ -248,6 +266,8 @@ func (s *APIBackend) ListBlockedPeers(_ context.Context) ([]peer.ID, error) {
// BlockAddr adds an IP address to the set of blocked addresses. // BlockAddr adds an IP address to the set of blocked addresses.
// Note: active connections to the IP address are not automatically closed. // Note: active connections to the IP address are not automatically closed.
func (s *APIBackend) BlockAddr(_ context.Context, ip net.IP) error { func (s *APIBackend) BlockAddr(_ context.Context, ip net.IP) error {
recordDur := s.m.RecordRPCServerRequest("opp2p_blockAddr")
defer recordDur()
if gater := s.node.ConnectionGater(); gater == nil { if gater := s.node.ConnectionGater(); gater == nil {
return NoConnectionGater return NoConnectionGater
} else { } else {
...@@ -256,6 +276,8 @@ func (s *APIBackend) BlockAddr(_ context.Context, ip net.IP) error { ...@@ -256,6 +276,8 @@ func (s *APIBackend) BlockAddr(_ context.Context, ip net.IP) error {
} }
func (s *APIBackend) UnblockAddr(_ context.Context, ip net.IP) error { func (s *APIBackend) UnblockAddr(_ context.Context, ip net.IP) error {
recordDur := s.m.RecordRPCServerRequest("opp2p_unblockAddr")
defer recordDur()
if gater := s.node.ConnectionGater(); gater == nil { if gater := s.node.ConnectionGater(); gater == nil {
return NoConnectionGater return NoConnectionGater
} else { } else {
...@@ -264,6 +286,8 @@ func (s *APIBackend) UnblockAddr(_ context.Context, ip net.IP) error { ...@@ -264,6 +286,8 @@ func (s *APIBackend) UnblockAddr(_ context.Context, ip net.IP) error {
} }
func (s *APIBackend) ListBlockedAddrs(_ context.Context) ([]net.IP, error) { func (s *APIBackend) ListBlockedAddrs(_ context.Context) ([]net.IP, error) {
recordDur := s.m.RecordRPCServerRequest("opp2p_listBlockedAddrs")
defer recordDur()
if gater := s.node.ConnectionGater(); gater == nil { if gater := s.node.ConnectionGater(); gater == nil {
return nil, NoConnectionGater return nil, NoConnectionGater
} else { } else {
...@@ -274,6 +298,8 @@ func (s *APIBackend) ListBlockedAddrs(_ context.Context) ([]net.IP, error) { ...@@ -274,6 +298,8 @@ func (s *APIBackend) ListBlockedAddrs(_ context.Context) ([]net.IP, error) {
// BlockSubnet adds an IP subnet to the set of blocked addresses. // BlockSubnet adds an IP subnet to the set of blocked addresses.
// Note: active connections to the IP subnet are not automatically closed. // Note: active connections to the IP subnet are not automatically closed.
func (s *APIBackend) BlockSubnet(_ context.Context, ipnet *net.IPNet) error { func (s *APIBackend) BlockSubnet(_ context.Context, ipnet *net.IPNet) error {
recordDur := s.m.RecordRPCServerRequest("opp2p_blockSubnet")
defer recordDur()
if gater := s.node.ConnectionGater(); gater == nil { if gater := s.node.ConnectionGater(); gater == nil {
return NoConnectionGater return NoConnectionGater
} else { } else {
...@@ -282,6 +308,8 @@ func (s *APIBackend) BlockSubnet(_ context.Context, ipnet *net.IPNet) error { ...@@ -282,6 +308,8 @@ func (s *APIBackend) BlockSubnet(_ context.Context, ipnet *net.IPNet) error {
} }
func (s *APIBackend) UnblockSubnet(_ context.Context, ipnet *net.IPNet) error { func (s *APIBackend) UnblockSubnet(_ context.Context, ipnet *net.IPNet) error {
recordDur := s.m.RecordRPCServerRequest("opp2p_unblockSubnet")
defer recordDur()
if gater := s.node.ConnectionGater(); gater == nil { if gater := s.node.ConnectionGater(); gater == nil {
return NoConnectionGater return NoConnectionGater
} else { } else {
...@@ -290,6 +318,8 @@ func (s *APIBackend) UnblockSubnet(_ context.Context, ipnet *net.IPNet) error { ...@@ -290,6 +318,8 @@ func (s *APIBackend) UnblockSubnet(_ context.Context, ipnet *net.IPNet) error {
} }
func (s *APIBackend) ListBlockedSubnets(_ context.Context) ([]*net.IPNet, error) { func (s *APIBackend) ListBlockedSubnets(_ context.Context) ([]*net.IPNet, error) {
recordDur := s.m.RecordRPCServerRequest("opp2p_listBlockedSubnets")
defer recordDur()
if gater := s.node.ConnectionGater(); gater == nil { if gater := s.node.ConnectionGater(); gater == nil {
return nil, NoConnectionGater return nil, NoConnectionGater
} else { } else {
...@@ -298,6 +328,8 @@ func (s *APIBackend) ListBlockedSubnets(_ context.Context) ([]*net.IPNet, error) ...@@ -298,6 +328,8 @@ func (s *APIBackend) ListBlockedSubnets(_ context.Context) ([]*net.IPNet, error)
} }
func (s *APIBackend) ProtectPeer(_ context.Context, p peer.ID) error { func (s *APIBackend) ProtectPeer(_ context.Context, p peer.ID) error {
recordDur := s.m.RecordRPCServerRequest("opp2p_protectPeer")
defer recordDur()
if manager := s.node.ConnectionManager(); manager == nil { if manager := s.node.ConnectionManager(); manager == nil {
return NoConnectionManager return NoConnectionManager
} else { } else {
...@@ -307,6 +339,8 @@ func (s *APIBackend) ProtectPeer(_ context.Context, p peer.ID) error { ...@@ -307,6 +339,8 @@ func (s *APIBackend) ProtectPeer(_ context.Context, p peer.ID) error {
} }
func (s *APIBackend) UnprotectPeer(_ context.Context, p peer.ID) error { func (s *APIBackend) UnprotectPeer(_ context.Context, p peer.ID) error {
recordDur := s.m.RecordRPCServerRequest("opp2p_unprotectPeer")
defer recordDur()
if manager := s.node.ConnectionManager(); manager == nil { if manager := s.node.ConnectionManager(); manager == nil {
return NoConnectionManager return NoConnectionManager
} else { } else {
...@@ -317,6 +351,8 @@ func (s *APIBackend) UnprotectPeer(_ context.Context, p peer.ID) error { ...@@ -317,6 +351,8 @@ func (s *APIBackend) UnprotectPeer(_ context.Context, p peer.ID) error {
// ConnectPeer connects to a given peer address, and wait for protocol negotiation & identification of the peer // ConnectPeer connects to a given peer address, and wait for protocol negotiation & identification of the peer
func (s *APIBackend) ConnectPeer(ctx context.Context, addr string) error { func (s *APIBackend) ConnectPeer(ctx context.Context, addr string) error {
recordDur := s.m.RecordRPCServerRequest("opp2p_connectPeer")
defer recordDur()
h := s.node.Host() h := s.node.Host()
addrInfo, err := peer.AddrInfoFromString(addr) addrInfo, err := peer.AddrInfoFromString(addr)
if err != nil { if err != nil {
...@@ -329,5 +365,7 @@ func (s *APIBackend) ConnectPeer(ctx context.Context, addr string) error { ...@@ -329,5 +365,7 @@ func (s *APIBackend) ConnectPeer(ctx context.Context, addr string) error {
} }
func (s *APIBackend) DisconnectPeer(_ context.Context, id peer.ID) error { func (s *APIBackend) DisconnectPeer(_ context.Context, id peer.ID) error {
recordDur := s.m.RecordRPCServerRequest("opp2p_disconnectPeer")
defer recordDur()
return s.node.Host().Network().ClosePeer(id) return s.node.Host().Network().ClosePeer(id)
} }
...@@ -58,6 +58,11 @@ func NewConfig(ctx *cli.Context, log log.Logger) (*node.Config, error) { ...@@ -58,6 +58,11 @@ func NewConfig(ctx *cli.Context, log log.Logger) (*node.Config, error) {
ListenAddr: ctx.GlobalString(flags.RPCListenAddr.Name), ListenAddr: ctx.GlobalString(flags.RPCListenAddr.Name),
ListenPort: ctx.GlobalInt(flags.RPCListenPort.Name), ListenPort: ctx.GlobalInt(flags.RPCListenPort.Name),
}, },
Metrics: node.MetricsConfig{
Enabled: ctx.GlobalBool(flags.MetricsEnabledFlag.Name),
ListenAddr: ctx.GlobalString(flags.MetricsAddrFlag.Name),
ListenPort: ctx.GlobalInt(flags.MetricsPortFlag.Name),
},
P2P: p2pConfig, P2P: p2pConfig,
P2PSigner: p2pSignerSetup, P2PSigner: p2pSignerSetup,
} }
......
...@@ -4,3 +4,8 @@ ...@@ -4,3 +4,8 @@
Since we use the same logging, but as an external package, we have to move the test utility to our own internal package. Since we use the same logging, but as an external package, we have to move the test utility to our own internal package.
This fork also made minor modifications:
- Enable color by default.
- Add `estimateInfoLen` and use this for message padding in `flush()` to align the contents of the log entries,
compensating for the different lengths of the log decoration that the Go library adds.
...@@ -18,6 +18,9 @@ ...@@ -18,6 +18,9 @@
package testlog package testlog
import ( import (
"runtime"
"strconv"
"strings"
"sync" "sync"
"testing" "testing"
...@@ -66,7 +69,7 @@ func Logger(t *testing.T, level log.Lvl) log.Logger { ...@@ -66,7 +69,7 @@ func Logger(t *testing.T, level log.Lvl) log.Logger {
t: t, t: t,
l: log.New(), l: log.New(),
mu: new(sync.Mutex), mu: new(sync.Mutex),
h: &bufHandler{fmt: log.TerminalFormat(false)}, h: &bufHandler{fmt: log.TerminalFormat(true)},
} }
l.l.SetHandler(log.LvlFilterHandler(level, l.h)) l.l.SetHandler(log.LvlFilterHandler(level, l.h))
return l return l
...@@ -135,8 +138,42 @@ func (l *logger) SetHandler(h log.Handler) { ...@@ -135,8 +138,42 @@ func (l *logger) SetHandler(h log.Handler) {
// flush writes all buffered messages and clears the buffer. // flush writes all buffered messages and clears the buffer.
func (l *logger) flush() { func (l *logger) flush() {
l.t.Helper() l.t.Helper()
// 2 frame skip for flush() + public logger fn
decorationLen := estimateInfoLen(2)
padding := 20
if decorationLen <= 25 {
padding = 25 - decorationLen
}
for _, r := range l.h.buf { for _, r := range l.h.buf {
l.t.Logf("%s", l.h.fmt.Format(r)) l.t.Logf("%*s%s", padding, "", l.h.fmt.Format(r))
} }
l.h.buf = nil l.h.buf = nil
} }
// The Go testing lib uses the runtime package to get info about the calling site, and then decorates the line.
// We can't disable this decoration, but we can adjust the contents to align by padding after the info.
// To pad the right amount, we estimate how long the info is.
func estimateInfoLen(frameSkip int) int {
var pc [50]uintptr
// Skip two extra frames to account for this function
// and runtime.Callers itself.
n := runtime.Callers(frameSkip+2, pc[:])
if n == 0 {
return 8
}
frames := runtime.CallersFrames(pc[:n])
frame, _ := frames.Next()
file := frame.File
line := frame.Line
if file != "" {
// Truncate file name at last file name separator.
if index := strings.LastIndex(file, "/"); index >= 0 {
file = file[index+1:]
} else if index = strings.LastIndex(file, "\\"); index >= 0 {
file = file[index+1:]
}
return 4 + len(file) + 1 + len(strconv.FormatInt(int64(line), 10))
} else {
return 8
}
}
...@@ -119,9 +119,9 @@ require ( ...@@ -119,9 +119,9 @@ require (
github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pkg/errors v0.9.1 // indirect github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.11.0 // indirect github.com/prometheus/client_golang v1.12.2 // indirect
github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.30.0 // indirect github.com/prometheus/common v0.35.0 // indirect
github.com/prometheus/procfs v0.7.3 // indirect github.com/prometheus/procfs v0.7.3 // indirect
github.com/prometheus/tsdb v0.10.0 // indirect github.com/prometheus/tsdb v0.10.0 // indirect
github.com/raulk/clock v1.1.0 // indirect github.com/raulk/clock v1.1.0 // indirect
...@@ -143,12 +143,12 @@ require ( ...@@ -143,12 +143,12 @@ require (
go.uber.org/multierr v1.7.0 // indirect go.uber.org/multierr v1.7.0 // indirect
go.uber.org/zap v1.19.1 // indirect go.uber.org/zap v1.19.1 // indirect
golang.org/x/crypto v0.0.0-20220307211146-efcb8507fb70 // indirect golang.org/x/crypto v0.0.0-20220307211146-efcb8507fb70 // indirect
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5 // indirect golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
google.golang.org/grpc v1.40.0 // indirect google.golang.org/grpc v1.40.0 // indirect
google.golang.org/protobuf v1.27.1 // indirect google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
gopkg.in/urfave/cli.v1 v1.20.0 // indirect gopkg.in/urfave/cli.v1 v1.20.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
......
...@@ -281,10 +281,12 @@ github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2 ...@@ -281,10 +281,12 @@ github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2
github.com/go-kit/kit v0.10.0 h1:dXFJfIHVvUcpSgDOV+Ne6t7jXri8Tfv2uOLHUZ2XNuo= github.com/go-kit/kit v0.10.0 h1:dXFJfIHVvUcpSgDOV+Ne6t7jXri8Tfv2uOLHUZ2XNuo=
github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o=
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-logfmt/logfmt v0.5.0 h1:TrB8swr/68K7m9CcGut2g3UOihhbcbiMAYiuTXdEih4=
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA=
github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8=
github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
...@@ -516,6 +518,7 @@ github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u ...@@ -516,6 +518,7 @@ github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u
github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/jsternberg/zap-logfmt v1.0.0/go.mod h1:uvPs/4X51zdkcm5jXl5SYoN+4RK21K8mysFmDaM/h+o= github.com/jsternberg/zap-logfmt v1.0.0/go.mod h1:uvPs/4X51zdkcm5jXl5SYoN+4RK21K8mysFmDaM/h+o=
...@@ -782,6 +785,7 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ ...@@ -782,6 +785,7 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8=
github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8=
github.com/mr-tron/base58 v1.1.2/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mr-tron/base58 v1.1.2/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc=
...@@ -916,8 +920,10 @@ github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeD ...@@ -916,8 +920,10 @@ github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeD
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU=
github.com/prometheus/client_golang v1.10.0/go.mod h1:WJM3cc3yu7XKBKa/I8WeZm+V3eltZnBwfENSU7mdogU= github.com/prometheus/client_golang v1.10.0/go.mod h1:WJM3cc3yu7XKBKa/I8WeZm+V3eltZnBwfENSU7mdogU=
github.com/prometheus/client_golang v1.11.0 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ=
github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0=
github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY=
github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34=
github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
...@@ -935,8 +941,10 @@ github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB8 ...@@ -935,8 +941,10 @@ github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB8
github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s=
github.com/prometheus/common v0.18.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.18.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s=
github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
github.com/prometheus/common v0.30.0 h1:JEkYlQnpzrzQFxi6gnukFPdQ+ac82oRhzMcIduJu/Ug=
github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
github.com/prometheus/common v0.35.0 h1:Eyr+Pw2VymWejHqCugNaQXkAi6KayVNxaHeu6khmFBE=
github.com/prometheus/common v0.35.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA=
github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
...@@ -1255,8 +1263,10 @@ golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qx ...@@ -1255,8 +1263,10 @@ golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qx
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 h1:CIJ76btIcR3eFI5EgSo6k1qKw9KJexJuRLI9G7Hp5wE=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc=
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
...@@ -1265,6 +1275,7 @@ golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4Iltr ...@@ -1265,6 +1275,7 @@ golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4Iltr
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
...@@ -1365,10 +1376,12 @@ golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBc ...@@ -1365,10 +1376,12 @@ golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5 h1:y/woIyUBFbpQGKS0u1aHF/40WUDnek3fPOyD08H5Vng=
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c h1:aFV+BgZ4svzjfabn8ERpuB4JI4N6/rdy1iusx77G3oU=
golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY=
...@@ -1565,8 +1578,9 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj ...@@ -1565,8 +1578,9 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ=
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
......
...@@ -49,7 +49,7 @@ function wait_up { ...@@ -49,7 +49,7 @@ function wait_up {
((i=i+1)) ((i=i+1))
if [ "$i" -eq 200 ]; then if [ "$i" -eq 200 ]; then
echo " Timeout!" >&2 echo " Timeout!" >&2
exit 0 exit 1
fi fi
done done
echo "Done!" echo "Done!"
......
...@@ -58,9 +58,13 @@ services: ...@@ -58,9 +58,13 @@ services:
--p2p.listen.udp=9003 --p2p.listen.udp=9003
--snapshotlog.file=/op_log/snapshot.log --snapshotlog.file=/op_log/snapshot.log
--p2p.priv.path=/config/p2p-node-key.txt --p2p.priv.path=/config/p2p-node-key.txt
--metrics.enabled
--metrics.addr=0.0.0.0
--metrics.port=7300
ports: ports:
- "7545:8545" - "7545:8545"
- "9003:9003" - "9003:9003"
- "7300:7300"
volumes: volumes:
- ${PWD}/p2p-sequencer-key.txt:/config/p2p-sequencer-key.txt - ${PWD}/p2p-sequencer-key.txt:/config/p2p-sequencer-key.txt
- ${PWD}/p2p-node-key.txt:/config/p2p-node-key.txt - ${PWD}/p2p-node-key.txt:/config/p2p-node-key.txt
......
...@@ -45,6 +45,9 @@ WORKDIR /opt/optimism/packages/contracts ...@@ -45,6 +45,9 @@ WORKDIR /opt/optimism/packages/contracts
COPY ./ops/scripts/deployer.sh . COPY ./ops/scripts/deployer.sh .
CMD ["yarn", "run", "deploy"] CMD ["yarn", "run", "deploy"]
FROM base as deployer-bedrock
WORKDIR /opt/optimism/packages/contracts-bedrock
CMD ["yarn", "run", "deploy"]
FROM base as data-transport-layer FROM base as data-transport-layer
WORKDIR /opt/optimism/packages/data-transport-layer WORKDIR /opt/optimism/packages/data-transport-layer
......
FROM ethereum/client-go:alltools-v1.10.17 as geth
FROM ghcr.io/foundry-rs/foundry:latest as foundry
FROM python:3.8.12-slim-buster
ENV GOPATH /go
ENV PATH /usr/local/go/bin:$GOPATH/bin:$PATH
COPY --from=foundry /usr/local/bin/forge /usr/local/bin/forge
COPY --from=foundry /usr/local/bin/cast /usr/local/bin/cast
COPY --from=geth /usr/local/bin/abigen /usr/local/bin/abigen
COPY check-changed.sh /usr/local/bin/check-changed
RUN apt-get update && \
apt-get install -y curl openssh-client git build-essential ca-certificates jq musl && \
curl -sL https://deb.nodesource.com/setup_16.x -o nodesource_setup.sh && \
curl -sL https://go.dev/dl/go1.18.2.linux-amd64.tar.gz -o go1.18.2.linux-amd64.tar.gz && \
tar -C /usr/local/ -xzvf go1.18.2.linux-amd64.tar.gz && \
ln -s /usr/local/go/bin/gofmt /usr/local/bin/gofmt && \
bash nodesource_setup.sh && \
apt-get install -y nodejs && \
npm i -g yarn && \
npm i -g depcheck && \
pip install slither-analyzer && \
go install gotest.tools/gotestsum@latest && \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.46.2 && \
curl -fLSs https://raw.githubusercontent.com/CircleCI-Public/circleci-cli/master/install.sh | bash && \
chmod +x /usr/local/bin/check-changed
RUN echo "downloading solidity compilers" && \
curl -o solc-linux-amd64-v0.5.17+commit.d19bba13 -sL https://binaries.soliditylang.org/linux-amd64/solc-linux-amd64-v0.5.17+commit.d19bba13 && \
curl -o solc-linux-amd64-v0.8.9+commit.e5eed63a -sL https://binaries.soliditylang.org/linux-amd64/solc-linux-amd64-v0.8.9+commit.e5eed63a && \
curl -o solc-linux-amd64-v0.8.10+commit.fc410830 -sL https://binaries.soliditylang.org/linux-amd64/solc-linux-amd64-v0.8.10+commit.fc410830 && \
curl -o solc-linux-amd64-v0.8.12+commit.f00d7308 -sL https://binaries.soliditylang.org/linux-amd64/solc-linux-amd64-v0.8.12+commit.f00d7308 && \
echo "verifying checksums" && \
(echo "c35ce7a4d3ffa5747c178b1e24c8541b2e5d8a82c1db3719eb4433a1f19e16f3 solc-linux-amd64-v0.5.17+commit.d19bba13" | sha256sum --check --status - || exit 1) && \
(echo "f851f11fad37496baabaf8d6cb5c057ca0d9754fddb7a351ab580d7fd728cb94 solc-linux-amd64-v0.8.9+commit.e5eed63a" | sha256sum --check --status - || exit 1) && \
(echo "c7effacf28b9d64495f81b75228fbf4266ac0ec87e8f1adc489ddd8a4dd06d89 solc-linux-amd64-v0.8.10+commit.fc410830" | sha256sum --check --status - || exit 1) && \
(echo "556c3ec44faf8ff6b67933fa8a8a403abe82c978d6e581dbfec4bd07360bfbf3 solc-linux-amd64-v0.8.12+commit.f00d7308" | sha256sum --check --status - || exit 1) && \
echo "caching compilers" && \
mkdir -p ~/.cache/hardhat-nodejs/compilers/linux-amd64 && \
cp solc-linux-amd64-v0.5.17+commit.d19bba13 ~/.cache/hardhat-nodejs/compilers/linux-amd64/ && \
cp solc-linux-amd64-v0.8.9+commit.e5eed63a ~/.cache/hardhat-nodejs/compilers/linux-amd64/ && \
cp solc-linux-amd64-v0.8.10+commit.fc410830 ~/.cache/hardhat-nodejs/compilers/linux-amd64/ && \
cp solc-linux-amd64-v0.8.12+commit.f00d7308 ~/.cache/hardhat-nodejs/compilers/linux-amd64/ && \
mkdir -p ~/.svm/0.5.17 && \
cp solc-linux-amd64-v0.5.17+commit.d19bba13 ~/.svm/0.5.17/solc-0.5.17 && \
mkdir -p ~/.svm/0.8.9 && \
cp solc-linux-amd64-v0.8.9+commit.e5eed63a ~/.svm/0.8.9/solc-0.8.9 && \
mkdir -p ~/.svm/0.8.10 && \
cp solc-linux-amd64-v0.8.10+commit.fc410830 ~/.svm/0.8.10/solc-0.8.10 && \
mkdir -p ~/.svm/0.8.12 && \
cp solc-linux-amd64-v0.8.12+commit.f00d7308 ~/.svm/0.8.12/solc-0.8.12
#!/usr/bin/env bash
# Usage: check-changed.sh <diff-pattern>.
#
# This script compares the files changed in the <diff-pattern> to the git diff,
# and writes TRUE or FALSE to stdout if the diff matches/does not match. It is
# used by CircleCI jobs to determine if they need to run.
set -e
echoerr() { echo "$@" 1>&2; }
# Check if this is a CircleCI PR.
if [[ -n $CIRCLE_PULL_REQUEST ]]; then
PACKAGE=$1
# Craft the URL to the GitHub API. The access token is optional for the monorepo since it's an open-source repo.
GITHUB_API_URL="https://api.github.com/repos/ethereum-optimism/optimism/pulls/${CIRCLE_PULL_REQUEST/https:\/\/github.com\/ethereum-optimism\/optimism\/pull\//}"
echoerr "GitHub URL:"
echoerr "$GITHUB_API_URL"
# Grab the PR's base ref using the GitHub API.
PR=$(curl -H "Authorization: token $GITHUB_ACCESS_TOKEN" -H "Accept: application/vnd.github.v3+json" --retry 3 --retry-delay 1 -s "$GITHUB_API_URL")
echoerr "PR data:"
echoerr "$PR"
REF=$(echo "$PR" | jq -r ".base.ref")
echoerr "Base Ref: $REF"
echoerr "Base Ref SHA: $(git show-branch --sha1-name "$REF")"
echoerr "Curr Ref: $(git rev-parse --short HEAD)"
# Compare HEAD to the PR's base ref, stripping out the change percentages that come with git diff --dirstat.
# Pass in the diff pattern to grep, and echo TRUE if there's a match. False otherwise.
(git diff --dirstat=files,0 "$REF...HEAD" | sed 's/^[ 0-9.]\+% //g' | grep -q -E "$PACKAGE" && echo "TRUE") || echo "FALSE"
else
# Non-PR builds always require a rebuild.
echoerr "Not a PR build, requiring a total rebuild."
echo "TRUE"
fi
{
"name": "@eth-optimism/ci-builder",
"version": "0.0.0",
"scripts": {},
"license": "MIT",
"dependencies": {}
}
require('dotenv').config()
const isForkModeEnabled = !!process.env.FORK_URL const isForkModeEnabled = !!process.env.FORK_URL
const forkUrl = process.env.FORK_URL const forkUrl = process.env.FORK_URL
const forkStartingBlock = const forkStartingBlock =
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
}, },
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"dotenv": "^10.0.0",
"hardhat": "^2.9.6" "hardhat": "^2.9.6"
} }
} }
...@@ -27,26 +27,26 @@ L1CrossDomainMessenger_Test:testCannot_L1MessengerPause() (gas: 10844) ...@@ -27,26 +27,26 @@ L1CrossDomainMessenger_Test:testCannot_L1MessengerPause() (gas: 10844)
L1CrossDomainMessenger_Test:testCannot_L1MessengerUnpause() (gas: 10858) L1CrossDomainMessenger_Test:testCannot_L1MessengerUnpause() (gas: 10858)
L1CrossDomainMessenger_Test:test_L1MessengerMessageVersion() (gas: 8388) L1CrossDomainMessenger_Test:test_L1MessengerMessageVersion() (gas: 8388)
L1CrossDomainMessenger_Test:test_L1MessengerPause() (gas: 31860) L1CrossDomainMessenger_Test:test_L1MessengerPause() (gas: 31860)
L1CrossDomainMessenger_Test:test_L1MessengerRelayMessageSucceeds() (gas: 61261) L1CrossDomainMessenger_Test:test_L1MessengerRelayMessageSucceeds() (gas: 61217)
L1CrossDomainMessenger_Test:test_L1MessengerRelayMessageToSystemContract() (gas: 44881) L1CrossDomainMessenger_Test:test_L1MessengerRelayMessageToSystemContract() (gas: 44837)
L1CrossDomainMessenger_Test:test_L1MessengerRelayShouldRevertIfPaused() (gas: 41587) L1CrossDomainMessenger_Test:test_L1MessengerRelayShouldRevertIfPaused() (gas: 41587)
L1CrossDomainMessenger_Test:test_L1MessengerSendMessage() (gas: 172193) L1CrossDomainMessenger_Test:test_L1MessengerSendMessage() (gas: 172199)
L1CrossDomainMessenger_Test:test_L1MessengerTwiceSendMessage() (gas: 1254199) L1CrossDomainMessenger_Test:test_L1MessengerTwiceSendMessage() (gas: 1254211)
L1CrossDomainMessenger_Test:test_L1MessengerUnpause() (gas: 23804) L1CrossDomainMessenger_Test:test_L1MessengerUnpause() (gas: 23804)
L1CrossDomainMessenger_Test:test_L1MessengerXDomainSenderReverts() (gas: 10599) L1CrossDomainMessenger_Test:test_L1MessengerXDomainSenderReverts() (gas: 10599)
L1CrossDomainMessenger_Test:test_L1MessengerxDomainMessageSenderResets() (gas: 58579) L1CrossDomainMessenger_Test:test_L1MessengerxDomainMessageSenderResets() (gas: 59022)
L1StandardBridge_Test:test_depositERC20() (gas: 452856) L1StandardBridge_Test:test_depositERC20() (gas: 452889)
L1StandardBridge_Test:test_depositERC20To() (gas: 454632) L1StandardBridge_Test:test_depositERC20To() (gas: 454644)
L1StandardBridge_Test:test_depositETH() (gas: 247077) L1StandardBridge_Test:test_depositETH() (gas: 247083)
L1StandardBridge_Test:test_depositETHTo() (gas: 204961) L1StandardBridge_Test:test_depositETHTo() (gas: 204967)
L1StandardBridge_Test:test_finalizeERC20Withdrawal() (gas: 438745) L1StandardBridge_Test:test_finalizeERC20Withdrawal() (gas: 438779)
L1StandardBridge_Test:test_finalizeETHWithdrawal() (gas: 48005) L1StandardBridge_Test:test_finalizeETHWithdrawal() (gas: 48005)
L1StandardBridge_Test:test_initialize() (gas: 14885) L1StandardBridge_Test:test_initialize() (gas: 14885)
L1StandardBridge_Test:test_onlyEOADepositERC20() (gas: 12085) L1StandardBridge_Test:test_onlyEOADepositERC20() (gas: 12085)
L1StandardBridge_Test:test_onlyEOADepositETH() (gas: 30637) L1StandardBridge_Test:test_onlyEOADepositETH() (gas: 30637)
L1StandardBridge_Test:test_onlyL2BridgeFinalizeERC20Withdrawal() (gas: 23565) L1StandardBridge_Test:test_onlyL2BridgeFinalizeERC20Withdrawal() (gas: 23565)
L1StandardBridge_Test:test_onlyPortalFinalizeERC20Withdrawal() (gas: 22919) L1StandardBridge_Test:test_onlyPortalFinalizeERC20Withdrawal() (gas: 22919)
L1StandardBridge_Test:test_receive() (gas: 391817) L1StandardBridge_Test:test_receive() (gas: 391823)
L2CrossDomainMessenger_Test:testCannot_L2MessengerPause() (gas: 10843) L2CrossDomainMessenger_Test:testCannot_L2MessengerPause() (gas: 10843)
L2CrossDomainMessenger_Test:test_L2MessengerMessageVersion() (gas: 8410) L2CrossDomainMessenger_Test:test_L2MessengerMessageVersion() (gas: 8410)
L2CrossDomainMessenger_Test:test_L2MessengerPause() (gas: 31837) L2CrossDomainMessenger_Test:test_L2MessengerPause() (gas: 31837)
...@@ -57,27 +57,28 @@ L2CrossDomainMessenger_Test:test_L2MessengerSendMessage() (gas: 119682) ...@@ -57,27 +57,28 @@ L2CrossDomainMessenger_Test:test_L2MessengerSendMessage() (gas: 119682)
L2CrossDomainMessenger_Test:test_L2MessengerTwiceSendMessage() (gas: 133142) L2CrossDomainMessenger_Test:test_L2MessengerTwiceSendMessage() (gas: 133142)
L2CrossDomainMessenger_Test:test_L2MessengerXDomainSenderReverts() (gas: 10599) L2CrossDomainMessenger_Test:test_L2MessengerXDomainSenderReverts() (gas: 10599)
L2CrossDomainMessenger_Test:test_L2MessengerxDomainMessageSenderResets() (gas: 54881) L2CrossDomainMessenger_Test:test_L2MessengerxDomainMessageSenderResets() (gas: 54881)
L2OutputOracleTest:testCannot_appendEmptyOutput() (gas: 18216) L2OutputOracleTest:testCannot_appendEmptyOutput() (gas: 24163)
L2OutputOracleTest:testCannot_appendFutureTimetamp() (gas: 20183) L2OutputOracleTest:testCannot_appendFutureTimetamp() (gas: 26130)
L2OutputOracleTest:testCannot_appendOnWrongFork() (gas: 20462) L2OutputOracleTest:testCannot_appendOnWrongFork() (gas: 26415)
L2OutputOracleTest:testCannot_appendOutputIfNotSequencer() (gas: 17607) L2OutputOracleTest:testCannot_appendOutputIfNotSequencer() (gas: 23554)
L2OutputOracleTest:testCannot_appendUnexpectedBlockNumber() (gas: 20086) L2OutputOracleTest:testCannot_appendUnexpectedBlockNumber() (gas: 26039)
L2OutputOracleTest:testCannot_deleteL2Output_ifNotOwner() (gas: 18893) L2OutputOracleTest:testCannot_deleteL2Output_ifNotOwner() (gas: 24799)
L2OutputOracleTest:testCannot_deleteL2Output_withWrongRoot() (gas: 83353) L2OutputOracleTest:testCannot_deleteL2Output_withWrongRoot() (gas: 91157)
L2OutputOracleTest:testCannot_deleteL2Output_withWrongTime() (gas: 79346) L2OutputOracleTest:testCannot_deleteL2Output_withWrongTime() (gas: 87150)
L2OutputOracleTest:test_appendWithBlockhashAndHeight() (gas: 69126) L2OutputOracleTest:test_appendWithBlockhashAndHeight() (gas: 75061)
L2OutputOracleTest:test_appendingAnotherOutput() (gas: 70475) L2OutputOracleTest:test_appendingAnotherOutput() (gas: 76861)
L2OutputOracleTest:test_changeSequencer() (gas: 35473) L2OutputOracleTest:test_changeSequencer() (gas: 55776)
L2OutputOracleTest:test_computeL2Timestamp() (gas: 19323) L2OutputOracleTest:test_computeL2Timestamp() (gas: 30288)
L2OutputOracleTest:test_constructor() (gas: 40152) L2OutputOracleTest:test_constructor() (gas: 48845)
L2OutputOracleTest:test_deleteL2Output() (gas: 69237) L2OutputOracleTest:test_deleteL2Output() (gas: 76604)
L2OutputOracleTest:test_getL2Output() (gas: 76099) L2OutputOracleTest:test_getL2Output() (gas: 83012)
L2OutputOracleTest:test_latestBlockNumber() (gas: 69878) L2OutputOracleTest:test_latestBlockNumber() (gas: 76264)
L2OutputOracleTest:test_nextBlockNumber() (gas: 9281) L2OutputOracleTest:test_nextBlockNumber() (gas: 15166)
L2OutputOracleTest:test_updateOwner() (gas: 24185) L2OutputOracleTest:test_updateOwner() (gas: 34646)
L2OutputOracleUpgradeable_Test:test_cannotInitImpl() (gas: 8431) L2OutputOracleUpgradeable_Test:test_cannotInitImpl() (gas: 8453)
L2OutputOracleUpgradeable_Test:test_cannotInitProxy() (gas: 13430) L2OutputOracleUpgradeable_Test:test_cannotInitProxy() (gas: 13430)
L2OutputOracleUpgradeable_Test:test_initValuesOnProxy() (gas: 38906) L2OutputOracleUpgradeable_Test:test_initValuesOnProxy() (gas: 38906)
L2OutputOracleUpgradeable_Test:test_upgrading() (gas: 230843)
L2StandardBridge_Test:test_ERC20BridgeFailed_whenLocalTokenIsBridge() (gas: 133097) L2StandardBridge_Test:test_ERC20BridgeFailed_whenLocalTokenIsBridge() (gas: 133097)
L2StandardBridge_Test:test_cannotWithdrawEthWithoutSendingIt() (gas: 21611) L2StandardBridge_Test:test_cannotWithdrawEthWithoutSendingIt() (gas: 21611)
L2StandardBridge_Test:test_finalizeDeposit() (gas: 93100) L2StandardBridge_Test:test_finalizeDeposit() (gas: 93100)
...@@ -113,19 +114,25 @@ OptimismMintableTokenFactory_Test:test_createStandardL2Token() (gas: 1100125) ...@@ -113,19 +114,25 @@ OptimismMintableTokenFactory_Test:test_createStandardL2Token() (gas: 1100125)
OptimismMintableTokenFactory_Test:test_createStandardL2TokenSameTwice() (gas: 2181161) OptimismMintableTokenFactory_Test:test_createStandardL2TokenSameTwice() (gas: 2181161)
OptimismMintableTokenFactory_Test:test_createStandardL2TokenShouldRevertIfRemoteIsZero() (gas: 9374) OptimismMintableTokenFactory_Test:test_createStandardL2TokenShouldRevertIfRemoteIsZero() (gas: 9374)
OptimismMintableTokenFactory_Test:test_initializeShouldRevert() (gas: 12696) OptimismMintableTokenFactory_Test:test_initializeShouldRevert() (gas: 12696)
OptimismPortal_Test:test_OptimismPortalConstructor() (gas: 11413) OptimismPortalUpgradeable_Test:test_cannotInitImpl() (gas: 10958)
OptimismPortal_Test:test_OptimismPortalContractCreationReverts() (gas: 9214) OptimismPortalUpgradeable_Test:test_cannotInitProxy() (gas: 15956)
OptimismPortal_Test:test_OptimismPortalReceiveEth() (gas: 121706) OptimismPortalUpgradeable_Test:test_initValuesOnProxy() (gas: 15967)
OptimismPortal_Test:test_cannotVerifyRecentWithdrawal() (gas: 21908) OptimismPortalUpgradeable_Test:test_upgrading() (gas: 230843)
OptimismPortal_Test:test_depositTransaction_NoValueContract() (gas: 70746) OptimismPortal_Test:test_OptimismPortalConstructor() (gas: 17286)
OptimismPortal_Test:test_depositTransaction_NoValueEOA() (gas: 71114) OptimismPortal_Test:test_OptimismPortalContractCreationReverts() (gas: 14214)
OptimismPortal_Test:test_depositTransaction_createWithZeroValueForContract() (gas: 70773) OptimismPortal_Test:test_OptimismPortalReceiveEth() (gas: 126643)
OptimismPortal_Test:test_depositTransaction_createWithZeroValueForEOA() (gas: 71117) OptimismPortal_Test:test_cannotVerifyRecentWithdrawal() (gas: 31945)
OptimismPortal_Test:test_depositTransaction_withEthValueAndContractContractCreation() (gas: 77795) OptimismPortal_Test:test_depositTransaction_NoValueContract() (gas: 75774)
OptimismPortal_Test:test_depositTransaction_withEthValueAndEOAContractCreation() (gas: 69947) OptimismPortal_Test:test_depositTransaction_NoValueEOA() (gas: 76120)
OptimismPortal_Test:test_depositTransaction_withEthValueFromContract() (gas: 77478) OptimismPortal_Test:test_depositTransaction_createWithZeroValueForContract() (gas: 75779)
OptimismPortal_Test:test_depositTransaction_withEthValueFromEOA() (gas: 78049) OptimismPortal_Test:test_depositTransaction_createWithZeroValueForEOA() (gas: 76123)
OptimismPortal_Test:test_invalidWithdrawalProof() (gas: 33769) OptimismPortal_Test:test_depositTransaction_withEthValueAndContractContractCreation() (gas: 82823)
OptimismPortal_Test:test_depositTransaction_withEthValueAndEOAContractCreation() (gas: 74941)
OptimismPortal_Test:test_depositTransaction_withEthValueFromContract() (gas: 82484)
OptimismPortal_Test:test_depositTransaction_withEthValueFromEOA() (gas: 83100)
OptimismPortal_Test:test_invalidWithdrawalProof() (gas: 45251)
OptimismPortal_Test:test_isOutputFinalized() (gas: 132162)
OptimismPortal_Test:test_simple_isOutputFinalized() (gas: 23965)
Proxy_Test:test_clashingFunctionSignatures() (gas: 101427) Proxy_Test:test_clashingFunctionSignatures() (gas: 101427)
Proxy_Test:test_implementationKey() (gas: 20942) Proxy_Test:test_implementationKey() (gas: 20942)
Proxy_Test:test_implementationProxyCallIfNotAdmin() (gas: 30021) Proxy_Test:test_implementationProxyCallIfNotAdmin() (gas: 30021)
......
...@@ -91,11 +91,19 @@ ...@@ -91,11 +91,19 @@
+----------------------+----------------------------------------+------+--------+-------+ +----------------------+----------------------------------------+------+--------+-------+
| Name | Type | Slot | Offset | Bytes | | Name | Type | Slot | Offset | Bytes |
+=======================================================================================+ +=======================================================================================+
| params | struct ResourceMetering.ResourceParams | 0 | 0 | 32 | | _initialized | uint8 | 0 | 0 | 1 |
|----------------------+----------------------------------------+------+--------+-------| |----------------------+----------------------------------------+------+--------+-------|
| l2Sender | address | 1 | 0 | 20 | | _initializing | bool | 0 | 1 | 1 |
|----------------------+----------------------------------------+------+--------+-------| |----------------------+----------------------------------------+------+--------+-------|
| finalizedWithdrawals | mapping(bytes32 => bool) | 2 | 0 | 32 | | params | struct ResourceMetering.ResourceParams | 1 | 0 | 32 |
|----------------------+----------------------------------------+------+--------+-------|
| __gap | uint256[49] | 2 | 0 | 1568 |
|----------------------+----------------------------------------+------+--------+-------|
| l2Sender | address | 51 | 0 | 20 |
|----------------------+----------------------------------------+------+--------+-------|
| finalizedWithdrawals | mapping(bytes32 => bool) | 52 | 0 | 32 |
|----------------------+----------------------------------------+------+--------+-------|
| __gap | uint256[48] | 53 | 0 | 1536 |
+----------------------+----------------------------------------+------+--------+-------+ +----------------------+----------------------------------------+------+--------+-------+
======================= =======================
......
...@@ -6,6 +6,7 @@ import { WithdrawalVerifier } from "../libraries/Lib_WithdrawalVerifier.sol"; ...@@ -6,6 +6,7 @@ import { WithdrawalVerifier } from "../libraries/Lib_WithdrawalVerifier.sol";
import { AddressAliasHelper } from "../libraries/AddressAliasHelper.sol"; import { AddressAliasHelper } from "../libraries/AddressAliasHelper.sol";
import { ExcessivelySafeCall } from "../libraries/ExcessivelySafeCall.sol"; import { ExcessivelySafeCall } from "../libraries/ExcessivelySafeCall.sol";
import { ResourceMetering } from "./ResourceMetering.sol"; import { ResourceMetering } from "./ResourceMetering.sol";
import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
/** /**
* @custom:proxied * @custom:proxied
...@@ -14,7 +15,12 @@ import { ResourceMetering } from "./ResourceMetering.sol"; ...@@ -14,7 +15,12 @@ import { ResourceMetering } from "./ResourceMetering.sol";
* and L2. Messages sent directly to the OptimismPortal have no form of replayability. * and L2. Messages sent directly to the OptimismPortal have no form of replayability.
* Users are encouraged to use the L1CrossDomainMessenger for a higher-level interface. * Users are encouraged to use the L1CrossDomainMessenger for a higher-level interface.
*/ */
contract OptimismPortal is ResourceMetering { contract OptimismPortal is Initializable, ResourceMetering {
/**
* @notice Contract version number.
*/
uint8 public constant OPTIMISM_PORTAL_VERSION = 1;
/** /**
* @notice Emitted when a transaction is deposited from L1 to L2. The parameters of this event * @notice Emitted when a transaction is deposited from L1 to L2. The parameters of this event
* are read by the rollup node and used to derive deposit transactions on L2. * are read by the rollup node and used to derive deposit transactions on L2.
...@@ -65,7 +71,7 @@ contract OptimismPortal is ResourceMetering { ...@@ -65,7 +71,7 @@ contract OptimismPortal is ResourceMetering {
* of this variable is the default L2 sender address, then we are NOT inside of a call * of this variable is the default L2 sender address, then we are NOT inside of a call
* to finalizeWithdrawalTransaction. * to finalizeWithdrawalTransaction.
*/ */
address public l2Sender = DEFAULT_L2_SENDER; address public l2Sender;
/** /**
* @notice The L2 gas limit set when eth is deposited using the receive() function. * @notice The L2 gas limit set when eth is deposited using the receive() function.
...@@ -83,12 +89,29 @@ contract OptimismPortal is ResourceMetering { ...@@ -83,12 +89,29 @@ contract OptimismPortal is ResourceMetering {
mapping(bytes32 => bool) public finalizedWithdrawals; mapping(bytes32 => bool) public finalizedWithdrawals;
/** /**
* @param _l2Oracle Address of the L2OutputOracle. * @notice Reserve extra slots (to to a total of 50) in the storage layout for future upgrades.
* @param _finalizationPeriodSeconds Finalization time in seconds. */
uint256[48] private __gap;
/**
* @notice The constructor sets immutable values in the implementation.
* This means that these values can only changed by an upgrade. But the efficiency gains
* are worthwhile.
* Also ensures that the implementation is initialized upon deployment.
*/ */
constructor(L2OutputOracle _l2Oracle, uint256 _finalizationPeriodSeconds) { constructor(L2OutputOracle _l2Oracle, uint256 _finalizationPeriodSeconds) {
// Set these immutable values into the bytcode of the implementation.
L2_ORACLE = _l2Oracle; L2_ORACLE = _l2Oracle;
FINALIZATION_PERIOD_SECONDS = _finalizationPeriodSeconds; FINALIZATION_PERIOD_SECONDS = _finalizationPeriodSeconds;
initialize();
}
/**
* @notice Initializes the contract and parent contract(s).
*/
function initialize() public reinitializer(OPTIMISM_PORTAL_VERSION) {
l2Sender = DEFAULT_L2_SENDER;
__ResourceMetering_init();
} }
/** /**
...@@ -141,6 +164,36 @@ contract OptimismPortal is ResourceMetering { ...@@ -141,6 +164,36 @@ contract OptimismPortal is ResourceMetering {
emit TransactionDeposited(from, _to, msg.value, _value, _gasLimit, _isCreation, _data); emit TransactionDeposited(from, _to, msg.value, _value, _gasLimit, _isCreation, _data);
} }
/**
* @notice Determine if an L2 Output is finalized.
*
* @param _l2BlockNumber The number of the L2 block.
*/
function isOutputFinalized(uint256 _l2BlockNumber) external view returns (bool) {
L2OutputOracle.OutputProposal memory proposal = L2_ORACLE.getL2Output(_l2BlockNumber);
if (proposal.outputRoot == bytes32(uint256(0))) {
uint256 interval = L2_ORACLE.SUBMISSION_INTERVAL();
uint256 startingBlockNumber = L2_ORACLE.STARTING_BLOCK_NUMBER();
// Prevent underflow
if (startingBlockNumber > _l2BlockNumber) {
return false;
}
// Find the distance between the _l2BlockNumber, and the checkpoint block before it.
uint256 offset = (_l2BlockNumber - startingBlockNumber) % interval;
// Look up the checkpoint block after it.
proposal = L2_ORACLE.getL2Output(_l2BlockNumber + (interval - offset));
// False if that block is not yet appended.
if (proposal.outputRoot == bytes32(uint256(0))) {
return false;
}
}
return block.timestamp > proposal.timestamp + FINALIZATION_PERIOD_SECONDS;
}
/** /**
* @notice Finalizes a withdrawal transaction. * @notice Finalizes a withdrawal transaction.
* *
......
...@@ -58,9 +58,23 @@ contract ResourceMetering { ...@@ -58,9 +58,23 @@ contract ResourceMetering {
ResourceParams public params; ResourceParams public params;
/** /**
* @notice Sets initial resource parameter values. * @notice Reserve extra slots (to a total of 50) in the storage layout for future upgrades.
*/
uint256[49] private __gap;
/**
* @notice Set the initial values. In order to enable this contract to be used in an upgradable
* context, the constructor calls a separate init function.
*/ */
constructor() { constructor() {
__ResourceMetering_init();
}
/**
* @notice Sets initial resource parameter values. This function must either be called by the
* initializer function of an upgradeable child contract.
*/
function __ResourceMetering_init() internal {
params = ResourceParams({ params = ResourceParams({
prevBaseFee: INITIAL_BASE_FEE, prevBaseFee: INITIAL_BASE_FEE,
prevBoughtGas: 0, prevBoughtGas: 0,
......
...@@ -17,6 +17,8 @@ import { AddressAliasHelper } from "../libraries/AddressAliasHelper.sol"; ...@@ -17,6 +17,8 @@ import { AddressAliasHelper } from "../libraries/AddressAliasHelper.sol";
import { OVM_ETH } from "../L2/OVM_ETH.sol"; import { OVM_ETH } from "../L2/OVM_ETH.sol";
import { Lib_PredeployAddresses } from "../libraries/Lib_PredeployAddresses.sol"; import { Lib_PredeployAddresses } from "../libraries/Lib_PredeployAddresses.sol";
import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import { Proxy } from "../universal/Proxy.sol";
import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
contract CommonTest is Test { contract CommonTest is Test {
address alice = address(128); address alice = address(128);
...@@ -46,6 +48,7 @@ contract CommonTest is Test { ...@@ -46,6 +48,7 @@ contract CommonTest is Test {
contract L2OutputOracle_Initializer is CommonTest { contract L2OutputOracle_Initializer is CommonTest {
// Test target // Test target
L2OutputOracle oracle; L2OutputOracle oracle;
L2OutputOracle oracleImpl;
// Constructor arguments // Constructor arguments
address sequencer = 0x000000000000000000000000000000000000AbBa; address sequencer = 0x000000000000000000000000000000000000AbBa;
...@@ -69,7 +72,7 @@ contract L2OutputOracle_Initializer is CommonTest { ...@@ -69,7 +72,7 @@ contract L2OutputOracle_Initializer is CommonTest {
vm.warp(initL1Time); vm.warp(initL1Time);
vm.roll(startingBlockNumber); vm.roll(startingBlockNumber);
// Deploy the L2OutputOracle and transfer owernship to the sequencer // Deploy the L2OutputOracle and transfer owernship to the sequencer
oracle = new L2OutputOracle( oracleImpl = new L2OutputOracle(
submissionInterval, submissionInterval,
genesisL2Output, genesisL2Output,
historicalTotalBlocks, historicalTotalBlocks,
...@@ -79,6 +82,39 @@ contract L2OutputOracle_Initializer is CommonTest { ...@@ -79,6 +82,39 @@ contract L2OutputOracle_Initializer is CommonTest {
sequencer, sequencer,
owner owner
); );
Proxy proxy = new Proxy(alice);
vm.prank(alice);
proxy.upgradeToAndCall(
address(oracleImpl),
abi.encodeWithSelector(
L2OutputOracle.initialize.selector,
genesisL2Output,
startingBlockNumber,
sequencer,
owner
)
);
oracle = L2OutputOracle(address(proxy));
}
}
contract Portal_Initializer is L2OutputOracle_Initializer {
// Test target
OptimismPortal opImpl;
OptimismPortal op;
function setUp() public override virtual {
L2OutputOracle_Initializer.setUp();
opImpl = new OptimismPortal(oracle, 7 days);
Proxy proxy = new Proxy(alice);
vm.prank(alice);
proxy.upgradeToAndCall(
address(opImpl),
abi.encodeWithSelector(
OptimismPortal.initialize.selector
)
);
op = OptimismPortal(payable(address(proxy)));
} }
} }
...@@ -125,7 +161,7 @@ contract Messenger_Initializer is L2OutputOracle_Initializer { ...@@ -125,7 +161,7 @@ contract Messenger_Initializer is L2OutputOracle_Initializer {
super.setUp(); super.setUp();
// Deploy the OptimismPortal // Deploy the OptimismPortal
op = new OptimismPortal(oracle, 100); op = new OptimismPortal(oracle, 7 days);
vm.label(address(op), "OptimismPortal"); vm.label(address(op), "OptimismPortal");
L1Messenger = new L1CrossDomainMessenger(); L1Messenger = new L1CrossDomainMessenger();
...@@ -320,3 +356,19 @@ contract Bridge_Initializer is Messenger_Initializer { ...@@ -320,3 +356,19 @@ contract Bridge_Initializer is Messenger_Initializer {
); );
} }
} }
// Used for testing a future upgrade beyond the current implementations.
// We include some variables so that we can sanity check accessing storage values after an upgrade.
contract NextImpl is Initializable {
// Initializable occupies the zero-th slot.
bytes32 slot1;
bytes32[19] __gap;
bytes32 slot21;
bytes32 public constant slot21Init = bytes32(hex"1337");
function initialize() public reinitializer(2) {
// Slot21 is unused by an of our upgradeable contracts.
// This is used to verify that we can access this value after an upgrade.
slot21 = slot21Init;
}
}
...@@ -110,13 +110,7 @@ contract L1CrossDomainMessenger_Test is Messenger_Initializer { ...@@ -110,13 +110,7 @@ contract L1CrossDomainMessenger_Test is Messenger_Initializer {
// SentMessage event // SentMessage event
vm.expectEmit(true, true, true, true); vm.expectEmit(true, true, true, true);
emit SentMessage( emit SentMessage(recipient, alice, hex"ff", L1Messenger.messageNonce(), 100);
recipient,
alice,
hex"ff",
L1Messenger.messageNonce(),
100
);
vm.prank(alice); vm.prank(alice);
L1Messenger.sendMessage(recipient, hex"ff", uint32(100)); L1Messenger.sendMessage(recipient, hex"ff", uint32(100));
...@@ -128,10 +122,7 @@ contract L1CrossDomainMessenger_Test is Messenger_Initializer { ...@@ -128,10 +122,7 @@ contract L1CrossDomainMessenger_Test is Messenger_Initializer {
L1Messenger.sendMessage(recipient, hex"aa", uint32(500_000)); L1Messenger.sendMessage(recipient, hex"aa", uint32(500_000));
L1Messenger.sendMessage(recipient, hex"aa", uint32(500_000)); L1Messenger.sendMessage(recipient, hex"aa", uint32(500_000));
// the nonce increments for each message sent // the nonce increments for each message sent
assertEq( assertEq(nonce + 2, L1Messenger.messageNonce());
nonce + 2,
L1Messenger.messageNonce()
);
} }
function test_L1MessengerXDomainSenderReverts() external { function test_L1MessengerXDomainSenderReverts() external {
...@@ -151,20 +142,13 @@ contract L1CrossDomainMessenger_Test is Messenger_Initializer { ...@@ -151,20 +142,13 @@ contract L1CrossDomainMessenger_Test is Messenger_Initializer {
vm.expectCall(target, hex"1111"); vm.expectCall(target, hex"1111");
// set the value of op.l2Sender() to be the L2 Cross Domain Messenger. // set the value of op.l2Sender() to be the L2 Cross Domain Messenger.
uint256 senderSlotIndex = 1; uint256 senderSlotIndex = 51;
vm.store(address(op), bytes32(senderSlotIndex), bytes32(abi.encode(sender))); vm.store(address(op), bytes32(senderSlotIndex), bytes32(abi.encode(sender)));
vm.prank(address(op)); vm.prank(address(op));
vm.expectEmit(true, true, true, true); vm.expectEmit(true, true, true, true);
bytes32 hash = CrossDomainHashing.getVersionedHash( bytes32 hash = CrossDomainHashing.getVersionedHash(0, sender, target, 0, 0, hex"1111");
0,
sender,
target,
0,
0,
hex"1111"
);
emit RelayedMessage(hash); emit RelayedMessage(hash);
...@@ -206,7 +190,10 @@ contract L1CrossDomainMessenger_Test is Messenger_Initializer { ...@@ -206,7 +190,10 @@ contract L1CrossDomainMessenger_Test is Messenger_Initializer {
L1Messenger.xDomainMessageSender(); L1Messenger.xDomainMessageSender();
address sender = Lib_PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER; address sender = Lib_PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER;
uint256 senderSlotIndex = 1;
uint256 senderSlotIndex = 51;
bytes32 slotValue = vm.load(address(op), bytes32(senderSlotIndex));
vm.store(address(op), bytes32(senderSlotIndex), bytes32(abi.encode(sender))); vm.store(address(op), bytes32(senderSlotIndex), bytes32(abi.encode(sender)));
vm.prank(address(op)); vm.prank(address(op));
L1Messenger.relayMessage(0, address(0), address(0), 0, 0, hex""); L1Messenger.relayMessage(0, address(0), address(0), 0, 0, hex"");
......
//SPDX-License-Identifier: MIT //SPDX-License-Identifier: MIT
pragma solidity 0.8.10; pragma solidity 0.8.10;
import { L2OutputOracle_Initializer } from "./CommonTest.t.sol"; import { L2OutputOracle_Initializer, NextImpl } from "./CommonTest.t.sol";
import { L2OutputOracle } from "../L1/L2OutputOracle.sol"; import { L2OutputOracle } from "../L1/L2OutputOracle.sol";
import { Proxy } from "../universal/Proxy.sol"; import { Proxy } from "../universal/Proxy.sol";
contract L2OutputOracleTest is L2OutputOracle_Initializer { contract L2OutputOracleTest is L2OutputOracle_Initializer {
bytes32 appendedOutput1 = keccak256(abi.encode(1)); bytes32 appendedOutput1 = keccak256(abi.encode(1));
...@@ -336,28 +337,11 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer { ...@@ -336,28 +337,11 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer {
} }
contract L2OutputOracleUpgradeable_Test is L2OutputOracle_Initializer { contract L2OutputOracleUpgradeable_Test is L2OutputOracle_Initializer {
L2OutputOracle oracleImpl;
Proxy internal proxy; Proxy internal proxy;
uint64 initialBlockNum;
function setUp() override public { function setUp() public override {
super.setUp(); super.setUp();
initialBlockNum = uint64(block.number); proxy = Proxy(payable(address(oracle)));
// Rename the deployed oracle instance for the purposes of this test.
oracleImpl = oracle;
proxy = new Proxy(alice);
vm.prank(alice);
proxy.upgradeToAndCall(
address(oracleImpl),
abi.encodeWithSelector(
L2OutputOracle.initialize.selector,
genesisL2Output,
startingBlockNumber,
sequencer,
owner
)
);
} }
function test_initValuesOnProxy() external { function test_initValuesOnProxy() external {
...@@ -367,7 +351,9 @@ contract L2OutputOracleUpgradeable_Test is L2OutputOracle_Initializer { ...@@ -367,7 +351,9 @@ contract L2OutputOracleUpgradeable_Test is L2OutputOracle_Initializer {
assertEq(startingTimestamp, oracleImpl.STARTING_TIMESTAMP()); assertEq(startingTimestamp, oracleImpl.STARTING_TIMESTAMP());
assertEq(l2BlockTime, oracleImpl.L2_BLOCK_TIME()); assertEq(l2BlockTime, oracleImpl.L2_BLOCK_TIME());
L2OutputOracle.OutputProposal memory initOutput = oracleImpl.getL2Output(startingBlockNumber); L2OutputOracle.OutputProposal memory initOutput = oracleImpl.getL2Output(
startingBlockNumber
);
assertEq(genesisL2Output, initOutput.outputRoot); assertEq(genesisL2Output, initOutput.outputRoot);
assertEq(initL1Time, initOutput.timestamp); assertEq(initL1Time, initOutput.timestamp);
...@@ -384,4 +370,23 @@ contract L2OutputOracleUpgradeable_Test is L2OutputOracle_Initializer { ...@@ -384,4 +370,23 @@ contract L2OutputOracleUpgradeable_Test is L2OutputOracle_Initializer {
vm.expectRevert("Initializable: contract is already initialized"); vm.expectRevert("Initializable: contract is already initialized");
address(oracleImpl).call(abi.encodeWithSelector(L2OutputOracle.initialize.selector)); address(oracleImpl).call(abi.encodeWithSelector(L2OutputOracle.initialize.selector));
} }
function test_upgrading() external {
// Check an unused slot before upgrading.
bytes32 slot21Before = vm.load(address(oracle), bytes32(uint256(21)));
assertEq(bytes32(0), slot21Before);
NextImpl nextImpl = new NextImpl();
vm.startPrank(alice);
proxy.upgradeToAndCall(
address(nextImpl),
abi.encodeWithSelector(NextImpl.initialize.selector)
);
assertEq(proxy.implementation(), address(nextImpl));
// Verify that the NextImpl contract initialized its values according as expected
bytes32 slot21After = vm.load(address(oracle), bytes32(uint256(21)));
bytes32 slot21Expected = NextImpl(address(oracle)).slot21Init();
assertEq(slot21Expected, slot21After);
}
} }
//SPDX-License-Identifier: MIT //SPDX-License-Identifier: MIT
pragma solidity 0.8.10; pragma solidity 0.8.10;
import { L2OutputOracle_Initializer } from "./CommonTest.t.sol"; import { Portal_Initializer, CommonTest, NextImpl } from "./CommonTest.t.sol";
import { AddressAliasHelper } from "../libraries/AddressAliasHelper.sol"; import { AddressAliasHelper } from "../libraries/AddressAliasHelper.sol";
import { L2OutputOracle } from "../L1/L2OutputOracle.sol"; import { L2OutputOracle } from "../L1/L2OutputOracle.sol";
import { OptimismPortal } from "../L1/OptimismPortal.sol"; import { OptimismPortal } from "../L1/OptimismPortal.sol";
import { WithdrawalVerifier } from "../libraries/Lib_WithdrawalVerifier.sol"; import { WithdrawalVerifier } from "../libraries/Lib_WithdrawalVerifier.sol";
import { Proxy } from "../universal/Proxy.sol";
contract OptimismPortal_Test is L2OutputOracle_Initializer { contract OptimismPortal_Test is Portal_Initializer {
event TransactionDeposited( event TransactionDeposited(
address indexed from, address indexed from,
address indexed to, address indexed to,
...@@ -19,14 +20,6 @@ contract OptimismPortal_Test is L2OutputOracle_Initializer { ...@@ -19,14 +20,6 @@ contract OptimismPortal_Test is L2OutputOracle_Initializer {
bytes data bytes data
); );
// Test target
OptimismPortal op;
function setUp() public override {
L2OutputOracle_Initializer.setUp();
op = new OptimismPortal(oracle, 7 days);
}
function test_OptimismPortalConstructor() external { function test_OptimismPortalConstructor() external {
assertEq(op.FINALIZATION_PERIOD_SECONDS(), 7 days); assertEq(op.FINALIZATION_PERIOD_SECONDS(), 7 days);
assertEq(address(op.L2_ORACLE()), address(oracle)); assertEq(address(op.L2_ORACLE()), address(oracle));
...@@ -268,4 +261,103 @@ contract OptimismPortal_Test is L2OutputOracle_Initializer { ...@@ -268,4 +261,103 @@ contract OptimismPortal_Test is L2OutputOracle_Initializer {
vm.expectRevert("OptimismPortal: invalid output root proof"); vm.expectRevert("OptimismPortal: invalid output root proof");
op.finalizeWithdrawalTransaction(0, alice, alice, 0, 0, hex"", 0, outputRootProof, hex""); op.finalizeWithdrawalTransaction(0, alice, alice, 0, 0, hex"", 0, outputRootProof, hex"");
} }
function test_simple_isOutputFinalized() external {
vm.mockCall(
address(op.L2_ORACLE()),
abi.encodeWithSelector(
L2OutputOracle.getL2Output.selector
),
abi.encode(
L2OutputOracle.OutputProposal(
bytes32(uint256(1)),
0
)
)
);
// warp to the finalization period
vm.warp(op.FINALIZATION_PERIOD_SECONDS());
assertEq(op.isOutputFinalized(0), false);
// warp past the finalization period
vm.warp(op.FINALIZATION_PERIOD_SECONDS() + 1);
assertEq(op.isOutputFinalized(0), true);
}
function test_isOutputFinalized() external {
uint256 checkpoint = oracle.nextBlockNumber();
vm.roll(checkpoint);
vm.warp(oracle.computeL2Timestamp(checkpoint) + 1);
vm.prank(oracle.sequencer());
oracle.appendL2Output(keccak256(abi.encode(2)), checkpoint, 0, 0);
// warp to the final second of the finalization period
uint256 finalizationHorizon = block.timestamp + op.FINALIZATION_PERIOD_SECONDS();
vm.warp(finalizationHorizon);
// The checkpointed block should not be finalized until 1 second from now.
assertEq(op.isOutputFinalized(checkpoint), false);
// Nor should a block after it
assertEq(op.isOutputFinalized(checkpoint + 1), false);
// Nor a block before it, even though the finalization period has passed, there is
// not yet a checkpoint block on top of it for which that is true.
assertEq(op.isOutputFinalized(checkpoint - 1), false);
// warp past the finalization period
vm.warp(finalizationHorizon + 1);
// It should now be finalized.
assertEq(op.isOutputFinalized(checkpoint), true);
// So should the block before it.
assertEq(op.isOutputFinalized(checkpoint - 1), true);
// But not the block after it.
assertEq(op.isOutputFinalized(checkpoint + 1), false);
}
}
contract OptimismPortalUpgradeable_Test is Portal_Initializer {
Proxy internal proxy;
uint64 initialBlockNum;
function setUp() public override {
super.setUp();
initialBlockNum = uint64(block.number);
proxy = Proxy(payable(address(op)));
}
function test_initValuesOnProxy() external {
(uint128 prevBaseFee, uint64 prevBoughtGas, uint64 prevBlockNum) = OptimismPortal(
payable(address(proxy))
).params();
assertEq(prevBaseFee, opImpl.INITIAL_BASE_FEE());
assertEq(prevBoughtGas, 0);
assertEq(prevBlockNum, initialBlockNum);
}
function test_cannotInitProxy() external {
vm.expectRevert("Initializable: contract is already initialized");
address(proxy).call(abi.encodeWithSelector(OptimismPortal.initialize.selector));
}
function test_cannotInitImpl() external {
vm.expectRevert("Initializable: contract is already initialized");
address(opImpl).call(abi.encodeWithSelector(OptimismPortal.initialize.selector));
}
function test_upgrading() external {
// Check an unused slot before upgrading.
bytes32 slot21Before = vm.load(address(op), bytes32(uint256(21)));
assertEq(bytes32(0), slot21Before);
NextImpl nextImpl = new NextImpl();
vm.startPrank(alice);
proxy.upgradeToAndCall(
address(nextImpl),
abi.encodeWithSelector(NextImpl.initialize.selector)
);
assertEq(proxy.implementation(), address(nextImpl));
// Verify that the NextImpl contract initialized its values according as expected
bytes32 slot21After = vm.load(address(op), bytes32(uint256(21)));
bytes32 slot21Expected = NextImpl(address(op)).slot21Init();
assertEq(slot21Expected, slot21After);
}
} }
...@@ -3,8 +3,13 @@ pragma solidity 0.8.10; ...@@ -3,8 +3,13 @@ pragma solidity 0.8.10;
import { CommonTest } from "./CommonTest.t.sol"; import { CommonTest } from "./CommonTest.t.sol";
import { ResourceMetering } from "../L1/ResourceMetering.sol"; import { ResourceMetering } from "../L1/ResourceMetering.sol";
import { Proxy } from "../universal/Proxy.sol";
contract MeterUser is ResourceMetering { contract MeterUser is ResourceMetering {
constructor() {
__ResourceMetering_init();
}
function use(uint64 _amount) public metered(_amount) {} function use(uint64 _amount) public metered(_amount) {}
} }
......
...@@ -29,15 +29,18 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -29,15 +29,18 @@ const deployFn: DeployFunction = async (hre) => {
const proxy = await hre.deployments.get('OptimismPortalProxy') const proxy = await hre.deployments.get('OptimismPortalProxy')
const Proxy = await hre.ethers.getContractAt('Proxy', proxy.address) const Proxy = await hre.ethers.getContractAt('Proxy', proxy.address)
const portal = await hre.deployments.get('OptimismPortal')
const tx = await Proxy.upgradeTo(portal.address)
await tx.wait()
const OptimismPortal = await hre.ethers.getContractAt( const OptimismPortal = await hre.ethers.getContractAt(
'OptimismPortal', 'OptimismPortal',
proxy.address proxy.address
) )
const portal = await hre.deployments.get('OptimismPortal')
const tx = await Proxy.upgradeToAndCall(
portal.address,
OptimismPortal.interface.encodeFunctionData('initialize()')
)
await tx.wait()
const l2Oracle = await OptimismPortal.L2_ORACLE() const l2Oracle = await OptimismPortal.L2_ORACLE()
if (l2Oracle !== oracle.address) { if (l2Oracle !== oracle.address) {
throw new Error('L2 Oracle mismatch') throw new Error('L2 Oracle mismatch')
......
...@@ -14,5 +14,3 @@ remappings = [ ...@@ -14,5 +14,3 @@ remappings = [
] ]
extra_output = ['devdoc', 'userdoc', 'metadata', 'storageLayout'] extra_output = ['devdoc', 'userdoc', 'metadata', 'storageLayout']
bytecode_hash = 'none' bytecode_hash = 'none'
# build_info = true
...@@ -46,6 +46,9 @@ const config: HardhatUserConfig = { ...@@ -46,6 +46,9 @@ const config: HardhatUserConfig = {
accounts: [process.env.PRIVATE_KEY_DEPLOYER || ethers.constants.HashZero], accounts: [process.env.PRIVATE_KEY_DEPLOYER || ethers.constants.HashZero],
}, },
}, },
foundry: {
buildInfo: true,
},
paths: { paths: {
deploy: './deploy', deploy: './deploy',
deployments: './deployments', deployments: './deployments',
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
"prebuild": "yarn ts-node scripts/verifyFoundryInstall.ts", "prebuild": "yarn ts-node scripts/verifyFoundryInstall.ts",
"build": "hardhat compile && tsc && hardhat typechain", "build": "hardhat compile && tsc && hardhat typechain",
"build:ts": "tsc", "build:ts": "tsc",
"deploy": "hardhat deploy",
"test": "forge test", "test": "forge test",
"gas-snapshot": "forge snapshot", "gas-snapshot": "forge snapshot",
"storage-snapshot": "./scripts/storage-snapshot.sh", "storage-snapshot": "./scripts/storage-snapshot.sh",
...@@ -46,7 +47,7 @@ ...@@ -46,7 +47,7 @@
"devDependencies": { "devDependencies": {
"@eth-optimism/hardhat-deploy-config": "^0.2.0", "@eth-optimism/hardhat-deploy-config": "^0.2.0",
"@defi-wonderland/smock": "^2.0.2", "@defi-wonderland/smock": "^2.0.2",
"@foundry-rs/hardhat-forge": "^0.1.7", "@foundry-rs/hardhat-forge": "^0.1.9",
"@nomiclabs/hardhat-ethers": "^2.0.0", "@nomiclabs/hardhat-ethers": "^2.0.0",
"@nomiclabs/hardhat-waffle": "^2.0.0", "@nomiclabs/hardhat-waffle": "^2.0.0",
"@typechain/ethers-v5": "^7.0.1", "@typechain/ethers-v5": "^7.0.1",
......
...@@ -16,7 +16,7 @@ const adminSlot = ...@@ -16,7 +16,7 @@ const adminSlot =
const toCodeAddr = (addr: string) => { const toCodeAddr = (addr: string) => {
const address = ethers.utils.hexConcat([ const address = ethers.utils.hexConcat([
'0xc0d3c0d3c03dc03dc03dc03dc03dc03dc03d', '0xc0d3c0d3c0d3c0d3c0d3c0d3c0d3c0d3c0d3',
'0x' + addr.slice(prefix.length), '0x' + addr.slice(prefix.length),
]) ])
return ethers.utils.getAddress(address) return ethers.utils.getAddress(address)
......
import { ethers } from 'ethers'
import { DrippieConfig } from '../../src'
const config: DrippieConfig = {
TeleportrWithdrawal: {
interval: 60 * 60 * 24,
dripcheck: 'CheckBalanceHigh',
checkparams: {
target: '0x52ec2f3d7c5977a8e558c8d9c6000b615098e8fc',
threshold: ethers.utils.parseEther('1'),
},
actions: [
{
target: '0x78A25524D90E3D0596558fb43789bD800a5c3007',
data: {
fn: 'withdrawFromTeleportr',
args: [],
},
},
],
},
GelatoBalance: {
interval: 60 * 60 * 24,
dripcheck: 'CheckGelatoLow',
checkparams: {
treasury: '0x2807B4aE232b624023f87d0e237A3B1bf200Fd99',
recipient: '0xc37f6a6c4AB335E20d10F034B90386E2fb70bbF5',
threshold: ethers.utils.parseEther('0.1'),
},
actions: [
{
target: '0x2807B4aE232b624023f87d0e237A3B1bf200Fd99',
value: ethers.utils.parseEther('1'),
data: {
fn: 'depositFunds',
args: [
// receiver
'0xc37f6a6c4AB335E20d10F034B90386E2fb70bbF5',
// token
'0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee',
// amount
ethers.utils.parseEther('1'),
],
},
},
],
},
}
export default config
{
"address": "0xd5F62980C9d1bAa2A983bF16F8874A92F0050C48",
"abi": [
{
"anonymous": false,
"inputs": [
{
"components": [
{
"internalType": "address",
"name": "target",
"type": "address"
},
{
"internalType": "uint256",
"name": "threshold",
"type": "uint256"
}
],
"indexed": false,
"internalType": "struct CheckBalanceHigh.Params",
"name": "params",
"type": "tuple"
}
],
"name": "_EventToExposeStructInABI__Params",
"type": "event"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "_params",
"type": "bytes"
}
],
"name": "check",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
}
],
"args": [],
"numDeployments": 1,
"solcInputHash": "b09909e91a3ff9823ceba49a3a845230",
"metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"threshold\",\"type\":\"uint256\"}],\"indexed\":false,\"internalType\":\"struct CheckBalanceHigh.Params\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"_EventToExposeStructInABI__Params\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_params\",\"type\":\"bytes\"}],\"name\":\"check\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"title\":\"CheckBalanceHigh\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"DripCheck for checking if an account's balance is above a given threshold.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/universal/drippie/dripchecks/CheckBalanceHigh.sol\":\"CheckBalanceHigh\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"contracts/universal/drippie/IDripCheck.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.9;\\n\\ninterface IDripCheck {\\n // DripCheck contracts that want to take parameters as inputs MUST expose a struct called\\n // Params and an event _EventForExposingParamsStructInABI(Params params). This makes it\\n // possible to easily encode parameters on the client side. Solidity does not support generics\\n // so it's not possible to do this with explicit typing.\\n\\n function check(bytes memory _params) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x73db6ada63ed1f0eba24efd36099139e66908aa45c79c0d1defe2a59a9e9eb9d\",\"license\":\"MIT\"},\"contracts/universal/drippie/dripchecks/CheckBalanceHigh.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.9;\\n\\nimport { IDripCheck } from \\\"../IDripCheck.sol\\\";\\n\\n/**\\n * @title CheckBalanceHigh\\n * @notice DripCheck for checking if an account's balance is above a given threshold.\\n */\\ncontract CheckBalanceHigh is IDripCheck {\\n event _EventToExposeStructInABI__Params(Params params);\\n struct Params {\\n address target;\\n uint256 threshold;\\n }\\n\\n function check(bytes memory _params) external view returns (bool) {\\n Params memory params = abi.decode(_params, (Params));\\n\\n // Check target balance is above threshold.\\n return params.target.balance > params.threshold;\\n }\\n}\\n\",\"keccak256\":\"0x517f69b75b62b7b74d3d4fceb45ecacb9cf1d68b62a8517e2985a6e0da0a7575\",\"license\":\"MIT\"}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b50610239806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063c64b3bb514610030575b600080fd5b61004361003e3660046100c3565b610057565b604051901515815260200160405180910390f35b6000808280602001905181019061006e9190610192565b6020810151905173ffffffffffffffffffffffffffffffffffffffff1631119392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000602082840312156100d557600080fd5b813567ffffffffffffffff808211156100ed57600080fd5b818401915084601f83011261010157600080fd5b81358181111561011357610113610094565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561015957610159610094565b8160405282815287602084870101111561017257600080fd5b826020860160208301376000928101602001929092525095945050505050565b6000604082840312156101a457600080fd5b6040516040810181811067ffffffffffffffff821117156101c7576101c7610094565b604052825173ffffffffffffffffffffffffffffffffffffffff811681146101ee57600080fd5b8152602092830151928101929092525091905056fea2646970667358221220c3948eadf9cbb80bb928bc392291d583593cefbaff6536ec1485a7602e7f6b7f64736f6c63430008090033",
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063c64b3bb514610030575b600080fd5b61004361003e3660046100c3565b610057565b604051901515815260200160405180910390f35b6000808280602001905181019061006e9190610192565b6020810151905173ffffffffffffffffffffffffffffffffffffffff1631119392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000602082840312156100d557600080fd5b813567ffffffffffffffff808211156100ed57600080fd5b818401915084601f83011261010157600080fd5b81358181111561011357610113610094565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561015957610159610094565b8160405282815287602084870101111561017257600080fd5b826020860160208301376000928101602001929092525095945050505050565b6000604082840312156101a457600080fd5b6040516040810181811067ffffffffffffffff821117156101c7576101c7610094565b604052825173ffffffffffffffffffffffffffffffffffffffff811681146101ee57600080fd5b8152602092830151928101929092525091905056fea2646970667358221220c3948eadf9cbb80bb928bc392291d583593cefbaff6536ec1485a7602e7f6b7f64736f6c63430008090033",
"devdoc": {
"kind": "dev",
"methods": {},
"title": "CheckBalanceHigh",
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"notice": "DripCheck for checking if an account's balance is above a given threshold.",
"version": 1
},
"storageLayout": {
"storage": [],
"types": null
}
}
\ No newline at end of file
{
"address": "0x00B1D6438A4E7E3733Bd9fCe4A068b07A0E47620",
"abi": [
{
"anonymous": false,
"inputs": [
{
"components": [
{
"internalType": "address",
"name": "target",
"type": "address"
},
{
"internalType": "uint256",
"name": "threshold",
"type": "uint256"
}
],
"indexed": false,
"internalType": "struct CheckBalanceLow.Params",
"name": "params",
"type": "tuple"
}
],
"name": "_EventToExposeStructInABI__Params",
"type": "event"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "_params",
"type": "bytes"
}
],
"name": "check",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
}
],
"transactionHash": "0x65f0d04160b33d020aed8bfc4207f169d230549d8cff494f600b104fe0e689a1",
"receipt": {
"to": "0x4e59b44847b379578588920cA78FbF26c0B4956C",
"from": "0xc37f6a6c4AB335E20d10F034B90386E2fb70bbF5",
"contractAddress": null,
"transactionIndex": 81,
"gasUsed": "176640",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0xb1ddf0d044777738b0a1e53a28129e5d58076dbaa9b190843b76354706d8880b",
"transactionHash": "0x65f0d04160b33d020aed8bfc4207f169d230549d8cff494f600b104fe0e689a1",
"logs": [],
"blockNumber": 14981100,
"cumulativeGasUsed": "5262258",
"status": 1,
"byzantium": true
},
"args": [],
"numDeployments": 1,
"solcInputHash": "b09909e91a3ff9823ceba49a3a845230",
"metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"threshold\",\"type\":\"uint256\"}],\"indexed\":false,\"internalType\":\"struct CheckBalanceLow.Params\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"_EventToExposeStructInABI__Params\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_params\",\"type\":\"bytes\"}],\"name\":\"check\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"title\":\"CheckBalanceLow\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"DripCheck for checking if an account's balance is below a given threshold.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/universal/drippie/dripchecks/CheckBalanceLow.sol\":\"CheckBalanceLow\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"contracts/universal/drippie/IDripCheck.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.9;\\n\\ninterface IDripCheck {\\n // DripCheck contracts that want to take parameters as inputs MUST expose a struct called\\n // Params and an event _EventForExposingParamsStructInABI(Params params). This makes it\\n // possible to easily encode parameters on the client side. Solidity does not support generics\\n // so it's not possible to do this with explicit typing.\\n\\n function check(bytes memory _params) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x73db6ada63ed1f0eba24efd36099139e66908aa45c79c0d1defe2a59a9e9eb9d\",\"license\":\"MIT\"},\"contracts/universal/drippie/dripchecks/CheckBalanceLow.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.9;\\n\\nimport { IDripCheck } from \\\"../IDripCheck.sol\\\";\\n\\n/**\\n * @title CheckBalanceLow\\n * @notice DripCheck for checking if an account's balance is below a given threshold.\\n */\\ncontract CheckBalanceLow is IDripCheck {\\n event _EventToExposeStructInABI__Params(Params params);\\n struct Params {\\n address target;\\n uint256 threshold;\\n }\\n\\n function check(bytes memory _params) external view returns (bool) {\\n Params memory params = abi.decode(_params, (Params));\\n\\n // Check target ETH balance is below threshold.\\n return params.target.balance < params.threshold;\\n }\\n}\\n\",\"keccak256\":\"0xd6d8e6abcc1428666132e9d8140243fff23c564b6474927e18f30fe078801842\",\"license\":\"MIT\"}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b50610239806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063c64b3bb514610030575b600080fd5b61004361003e3660046100c3565b610057565b604051901515815260200160405180910390f35b6000808280602001905181019061006e9190610192565b6020810151905173ffffffffffffffffffffffffffffffffffffffff1631109392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000602082840312156100d557600080fd5b813567ffffffffffffffff808211156100ed57600080fd5b818401915084601f83011261010157600080fd5b81358181111561011357610113610094565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561015957610159610094565b8160405282815287602084870101111561017257600080fd5b826020860160208301376000928101602001929092525095945050505050565b6000604082840312156101a457600080fd5b6040516040810181811067ffffffffffffffff821117156101c7576101c7610094565b604052825173ffffffffffffffffffffffffffffffffffffffff811681146101ee57600080fd5b8152602092830151928101929092525091905056fea264697066735822122075d8f6816a6709f5b54613834c7be6979cb3af4abf6a1d38244135be431d562b64736f6c63430008090033",
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063c64b3bb514610030575b600080fd5b61004361003e3660046100c3565b610057565b604051901515815260200160405180910390f35b6000808280602001905181019061006e9190610192565b6020810151905173ffffffffffffffffffffffffffffffffffffffff1631109392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000602082840312156100d557600080fd5b813567ffffffffffffffff808211156100ed57600080fd5b818401915084601f83011261010157600080fd5b81358181111561011357610113610094565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561015957610159610094565b8160405282815287602084870101111561017257600080fd5b826020860160208301376000928101602001929092525095945050505050565b6000604082840312156101a457600080fd5b6040516040810181811067ffffffffffffffff821117156101c7576101c7610094565b604052825173ffffffffffffffffffffffffffffffffffffffff811681146101ee57600080fd5b8152602092830151928101929092525091905056fea264697066735822122075d8f6816a6709f5b54613834c7be6979cb3af4abf6a1d38244135be431d562b64736f6c63430008090033",
"devdoc": {
"kind": "dev",
"methods": {},
"title": "CheckBalanceLow",
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"notice": "DripCheck for checking if an account's balance is below a given threshold.",
"version": 1
},
"storageLayout": {
"storage": [],
"types": null
}
}
\ No newline at end of file
{
"address": "0x81d70959f29872A9e597a54658A93962F7D9B597",
"abi": [
{
"anonymous": false,
"inputs": [
{
"components": [
{
"internalType": "address",
"name": "treasury",
"type": "address"
},
{
"internalType": "uint256",
"name": "threshold",
"type": "uint256"
},
{
"internalType": "address",
"name": "recipient",
"type": "address"
}
],
"indexed": false,
"internalType": "struct CheckGelatoLow.Params",
"name": "params",
"type": "tuple"
}
],
"name": "_EventToExposeStructInABI__Params",
"type": "event"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "_params",
"type": "bytes"
}
],
"name": "check",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
}
],
"transactionHash": "0x4f3db725a79a177062c8ddbbedb005a96ecb8eab6e71c4172c1b37fa1c708688",
"receipt": {
"to": "0x4e59b44847b379578588920cA78FbF26c0B4956C",
"from": "0xc37f6a6c4AB335E20d10F034B90386E2fb70bbF5",
"contractAddress": null,
"transactionIndex": 53,
"gasUsed": "225248",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0xae292ed733027c5232a5775cd788ce31394cf4e7a068b7f2edbf8bd142e40d8f",
"transactionHash": "0x4f3db725a79a177062c8ddbbedb005a96ecb8eab6e71c4172c1b37fa1c708688",
"logs": [],
"blockNumber": 14981104,
"cumulativeGasUsed": "5063510",
"status": 1,
"byzantium": true
},
"args": [],
"numDeployments": 1,
"solcInputHash": "b09909e91a3ff9823ceba49a3a845230",
"metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"treasury\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"threshold\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"struct CheckGelatoLow.Params\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"_EventToExposeStructInABI__Params\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_params\",\"type\":\"bytes\"}],\"name\":\"check\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"title\":\"CheckGelatoLow\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"DripCheck for checking if an account's Gelato ETH balance is below some threshold.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/universal/drippie/dripchecks/CheckGelatoLow.sol\":\"CheckGelatoLow\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"contracts/universal/drippie/IDripCheck.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.9;\\n\\ninterface IDripCheck {\\n // DripCheck contracts that want to take parameters as inputs MUST expose a struct called\\n // Params and an event _EventForExposingParamsStructInABI(Params params). This makes it\\n // possible to easily encode parameters on the client side. Solidity does not support generics\\n // so it's not possible to do this with explicit typing.\\n\\n function check(bytes memory _params) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x73db6ada63ed1f0eba24efd36099139e66908aa45c79c0d1defe2a59a9e9eb9d\",\"license\":\"MIT\"},\"contracts/universal/drippie/dripchecks/CheckGelatoLow.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.9;\\n\\nimport { IDripCheck } from \\\"../IDripCheck.sol\\\";\\n\\ninterface IGelatoTreasury {\\n function userTokenBalance(address _user, address _token) external view returns (uint256);\\n}\\n\\n/**\\n * @title CheckGelatoLow\\n * @notice DripCheck for checking if an account's Gelato ETH balance is below some threshold.\\n */\\ncontract CheckGelatoLow is IDripCheck {\\n event _EventToExposeStructInABI__Params(Params params);\\n struct Params {\\n address treasury;\\n uint256 threshold;\\n address recipient;\\n }\\n\\n function check(bytes memory _params) external view returns (bool) {\\n Params memory params = abi.decode(_params, (Params));\\n\\n // Check GelatoTreasury ETH balance is below threshold.\\n return\\n IGelatoTreasury(params.treasury).userTokenBalance(\\n params.recipient,\\n // Gelato represents ETH as 0xeeeee....eeeee\\n 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE\\n ) < params.threshold;\\n }\\n}\\n\",\"keccak256\":\"0x8d936bc5e037a1b05225f2cd208ef6899b0d29cd3b91c73e5c16762eb242e5ef\",\"license\":\"MIT\"}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b5061031b806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063c64b3bb514610030575b600080fd5b61004361003e36600461016f565b610057565b604051901515815260200160405180910390f35b6000808280602001905181019061006e9190610267565b6020810151815160408084015190517fb47064c800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff918216600482015273eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6024820152939450919291169063b47064c89060440160206040518083038186803b15801561010057600080fd5b505afa158015610114573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061013891906102cc565b109392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561018157600080fd5b813567ffffffffffffffff8082111561019957600080fd5b818401915084601f8301126101ad57600080fd5b8135818111156101bf576101bf610140565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561020557610205610140565b8160405282815287602084870101111561021e57600080fd5b826020860160208301376000928101602001929092525095945050505050565b805173ffffffffffffffffffffffffffffffffffffffff8116811461026257600080fd5b919050565b60006060828403121561027957600080fd5b6040516060810181811067ffffffffffffffff8211171561029c5761029c610140565b6040526102a88361023e565b8152602083015160208201526102c06040840161023e565b60408201529392505050565b6000602082840312156102de57600080fd5b505191905056fea2646970667358221220e4e865f160af7ad5bd6e586c93c567a5f9a5ee5a652397683119d14d6f5e658464736f6c63430008090033",
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063c64b3bb514610030575b600080fd5b61004361003e36600461016f565b610057565b604051901515815260200160405180910390f35b6000808280602001905181019061006e9190610267565b6020810151815160408084015190517fb47064c800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff918216600482015273eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6024820152939450919291169063b47064c89060440160206040518083038186803b15801561010057600080fd5b505afa158015610114573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061013891906102cc565b109392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561018157600080fd5b813567ffffffffffffffff8082111561019957600080fd5b818401915084601f8301126101ad57600080fd5b8135818111156101bf576101bf610140565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561020557610205610140565b8160405282815287602084870101111561021e57600080fd5b826020860160208301376000928101602001929092525095945050505050565b805173ffffffffffffffffffffffffffffffffffffffff8116811461026257600080fd5b919050565b60006060828403121561027957600080fd5b6040516060810181811067ffffffffffffffff8211171561029c5761029c610140565b6040526102a88361023e565b8152602083015160208201526102c06040840161023e565b60408201529392505050565b6000602082840312156102de57600080fd5b505191905056fea2646970667358221220e4e865f160af7ad5bd6e586c93c567a5f9a5ee5a652397683119d14d6f5e658464736f6c63430008090033",
"devdoc": {
"kind": "dev",
"methods": {},
"title": "CheckGelatoLow",
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"notice": "DripCheck for checking if an account's Gelato ETH balance is below some threshold.",
"version": 1
},
"storageLayout": {
"storage": [],
"types": null
}
}
\ No newline at end of file
{
"address": "0x7e2B28af043c347C18fc37f62B5D001df6BFa26c",
"abi": [
{
"inputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"name": "check",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "pure",
"type": "function"
}
],
"transactionHash": "0x02af8af4f6eda0944e437af66082a71b3a0c9c52f3ab2ac4e4929538f94d9411",
"receipt": {
"to": "0x4e59b44847b379578588920cA78FbF26c0B4956C",
"from": "0xc37f6a6c4AB335E20d10F034B90386E2fb70bbF5",
"contractAddress": null,
"transactionIndex": 6,
"gasUsed": "139230",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0xbf599dc7b5468b1291bd41db9290db892c3e883c7f24cfa123f0ce4fa19d8bf3",
"transactionHash": "0x02af8af4f6eda0944e437af66082a71b3a0c9c52f3ab2ac4e4929538f94d9411",
"logs": [],
"blockNumber": 14981108,
"cumulativeGasUsed": "630300",
"status": 1,
"byzantium": true
},
"args": [],
"numDeployments": 1,
"solcInputHash": "b09909e91a3ff9823ceba49a3a845230",
"metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"check\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"title\":\"CheckTrue\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"DripCheck that always returns true.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/universal/drippie/dripchecks/CheckTrue.sol\":\"CheckTrue\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"contracts/universal/drippie/IDripCheck.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.9;\\n\\ninterface IDripCheck {\\n // DripCheck contracts that want to take parameters as inputs MUST expose a struct called\\n // Params and an event _EventForExposingParamsStructInABI(Params params). This makes it\\n // possible to easily encode parameters on the client side. Solidity does not support generics\\n // so it's not possible to do this with explicit typing.\\n\\n function check(bytes memory _params) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x73db6ada63ed1f0eba24efd36099139e66908aa45c79c0d1defe2a59a9e9eb9d\",\"license\":\"MIT\"},\"contracts/universal/drippie/dripchecks/CheckTrue.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.9;\\n\\nimport { IDripCheck } from \\\"../IDripCheck.sol\\\";\\n\\n/**\\n * @title CheckTrue\\n * @notice DripCheck that always returns true.\\n */\\ncontract CheckTrue is IDripCheck {\\n function check(bytes memory) external pure returns (bool) {\\n return true;\\n }\\n}\\n\",\"keccak256\":\"0x2ed60821a4302130b567da45f15dce5a7c41e5d5b016c32ec09c92d4fb5ba6e6\",\"license\":\"MIT\"}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b5061018c806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063c64b3bb514610030575b600080fd5b61004461003e366004610087565b50600190565b604051901515815260200160405180910390f35b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561009957600080fd5b813567ffffffffffffffff808211156100b157600080fd5b818401915084601f8301126100c557600080fd5b8135818111156100d7576100d7610058565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561011d5761011d610058565b8160405282815287602084870101111561013657600080fd5b82602086016020830137600092810160200192909252509594505050505056fea26469706673582212207179cc803626c6d5a28bb5725d572d164ec9b64d4f37f10f220761ee045840fc64736f6c63430008090033",
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063c64b3bb514610030575b600080fd5b61004461003e366004610087565b50600190565b604051901515815260200160405180910390f35b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561009957600080fd5b813567ffffffffffffffff808211156100b157600080fd5b818401915084601f8301126100c557600080fd5b8135818111156100d7576100d7610058565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561011d5761011d610058565b8160405282815287602084870101111561013657600080fd5b82602086016020830137600092810160200192909252509594505050505056fea26469706673582212207179cc803626c6d5a28bb5725d572d164ec9b64d4f37f10f220761ee045840fc64736f6c63430008090033",
"devdoc": {
"kind": "dev",
"methods": {},
"title": "CheckTrue",
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"notice": "DripCheck that always returns true.",
"version": 1
},
"storageLayout": {
"storage": [],
"types": null
}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"address": "0x78A25524D90E3D0596558fb43789bD800a5c3007",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "_owner",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "user",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnerUpdated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "ReceivedETH",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "withdrawer",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "asset",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "WithdrewERC20",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "withdrawer",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "asset",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "id",
"type": "uint256"
}
],
"name": "WithdrewERC721",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "withdrawer",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "WithdrewETH",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "_target",
"type": "address"
},
{
"internalType": "bytes",
"name": "_data",
"type": "bytes"
},
{
"internalType": "uint256",
"name": "_gas",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_value",
"type": "uint256"
}
],
"name": "CALL",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
},
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_target",
"type": "address"
},
{
"internalType": "bytes",
"name": "_data",
"type": "bytes"
},
{
"internalType": "uint256",
"name": "_gas",
"type": "uint256"
}
],
"name": "DELEGATECALL",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
},
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [],
"name": "data",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "recipient",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "_data",
"type": "bytes"
}
],
"name": "setData",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "setOwner",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_recipient",
"type": "address"
}
],
"name": "setRecipient",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_teleportr",
"type": "address"
}
],
"name": "setTeleportr",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "teleportr",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract ERC20",
"name": "_asset",
"type": "address"
},
{
"internalType": "address",
"name": "_to",
"type": "address"
},
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
}
],
"name": "withdrawERC20",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract ERC20",
"name": "_asset",
"type": "address"
},
{
"internalType": "address",
"name": "_to",
"type": "address"
}
],
"name": "withdrawERC20",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract ERC721",
"name": "_asset",
"type": "address"
},
{
"internalType": "address",
"name": "_to",
"type": "address"
},
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
}
],
"name": "withdrawERC721",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address payable",
"name": "_to",
"type": "address"
},
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
}
],
"name": "withdrawETH",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address payable",
"name": "_to",
"type": "address"
}
],
"name": "withdrawETH",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "withdrawFromTeleportr",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"stateMutability": "payable",
"type": "receive"
}
],
"transactionHash": "0xe7914c509af8b99ef3421601b487ccdf2c7ef5955ffbd58bbb7d786452df3638",
"receipt": {
"to": "0x4e59b44847b379578588920cA78FbF26c0B4956C",
"from": "0xc37f6a6c4AB335E20d10F034B90386E2fb70bbF5",
"contractAddress": null,
"transactionIndex": 249,
"gasUsed": "1233027",
"logsBloom": "0x00000000000000000001000000000000000000000000000000000000000000000000100000000000000000000000080000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000080000000020000000000000000000800000000000080000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000004000000020000000000000000000000000000000000000000000000",
"blockHash": "0xbdb85532b8a9423604350b1254f5b465838c92bffaecd1768cf94b95e58ffa80",
"transactionHash": "0xe7914c509af8b99ef3421601b487ccdf2c7ef5955ffbd58bbb7d786452df3638",
"logs": [
{
"transactionIndex": 249,
"blockNumber": 14981055,
"transactionHash": "0xe7914c509af8b99ef3421601b487ccdf2c7ef5955ffbd58bbb7d786452df3638",
"address": "0x78A25524D90E3D0596558fb43789bD800a5c3007",
"topics": [
"0x8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d76",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000009c6373de60c2d3297b18a8f964618ac46e011b58"
],
"data": "0x",
"logIndex": 574,
"blockHash": "0xbdb85532b8a9423604350b1254f5b465838c92bffaecd1768cf94b95e58ffa80"
}
],
"blockNumber": 14981055,
"cumulativeGasUsed": "26253070",
"status": 1,
"byzantium": true
},
"args": [
"0x9C6373dE60c2D3297b18A8f964618ac46E011B58"
],
"numDeployments": 1,
"solcInputHash": "b09909e91a3ff9823ceba49a3a845230",
"metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnerUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"ReceivedETH\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"withdrawer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"WithdrewERC20\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"withdrawer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"WithdrewERC721\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"withdrawer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"WithdrewETH\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_gas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"CALL\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_gas\",\"type\":\"uint256\"}],\"name\":\"DELEGATECALL\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"data\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"recipient\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"setData\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"setOwner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"}],\"name\":\"setRecipient\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_teleportr\",\"type\":\"address\"}],\"name\":\"setTeleportr\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"teleportr\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"_asset\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawERC20\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"_asset\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"}],\"name\":\"withdrawERC20\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ERC721\",\"name\":\"_asset\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"}],\"name\":\"withdrawERC721\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawETH\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"_to\",\"type\":\"address\"}],\"name\":\"withdrawETH\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdrawFromTeleportr\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"CALL(address,bytes,uint256,uint256)\":{\"params\":{\"_data\":\"Data to send with the call.\",\"_gas\":\"Amount of gas to send with the call.\",\"_target\":\"Address to call.\",\"_value\":\"ETH value to send with the call.\"},\"returns\":{\"_0\":\"Boolean success value.\",\"_1\":\"Bytes data returned by the call.\"}},\"DELEGATECALL(address,bytes,uint256)\":{\"params\":{\"_data\":\"Data to send with the call.\",\"_gas\":\"Amount of gas to send with the call.\",\"_target\":\"Address to call.\"},\"returns\":{\"_0\":\"Boolean success value.\",\"_1\":\"Bytes data returned by the call.\"}},\"constructor\":{\"params\":{\"_owner\":\"Initial owner of the contract.\"}},\"setData(bytes)\":{\"params\":{\"_data\":\"New data to be sent to the recipient address.\"}},\"setRecipient(address)\":{\"params\":{\"_recipient\":\"New recipient address.\"}},\"setTeleportr(address)\":{\"params\":{\"_teleportr\":\"New Teleportr contract address.\"}},\"withdrawERC20(address,address)\":{\"params\":{\"_asset\":\"ERC20 token to withdraw.\",\"_to\":\"Address to receive the ERC20 balance.\"}},\"withdrawERC20(address,address,uint256)\":{\"params\":{\"_amount\":\"Amount of ERC20 to withdraw.\",\"_asset\":\"ERC20 token to withdraw.\",\"_to\":\"Address to receive the ERC20 balance.\"}},\"withdrawERC721(address,address,uint256)\":{\"params\":{\"_asset\":\"ERC721 token to withdraw.\",\"_id\":\"Token ID of the ERC721 token to withdraw.\",\"_to\":\"Address to receive the ERC721 token.\"}},\"withdrawETH(address)\":{\"params\":{\"_to\":\"Address to receive the ETH balance.\"}},\"withdrawETH(address,uint256)\":{\"params\":{\"_amount\":\"Amount of ETH to withdraw.\",\"_to\":\"Address to receive the ETH balance.\"}}},\"title\":\"TeleportrWithdrawer\",\"version\":1},\"userdoc\":{\"events\":{\"ReceivedETH(address,uint256)\":{\"notice\":\"Emitted when ETH is received by this address.\"},\"WithdrewERC20(address,address,address,uint256)\":{\"notice\":\"Emitted when ERC20 tokens are withdrawn from this address.\"},\"WithdrewERC721(address,address,address,uint256)\":{\"notice\":\"Emitted when ERC721 tokens are withdrawn from this address.\"},\"WithdrewETH(address,address,uint256)\":{\"notice\":\"Emitted when ETH is withdrawn from this address.\"}},\"kind\":\"user\",\"methods\":{\"CALL(address,bytes,uint256,uint256)\":{\"notice\":\"Sends a CALL to a target address.\"},\"DELEGATECALL(address,bytes,uint256)\":{\"notice\":\"Sends a DELEGATECALL to a target address.\"},\"data()\":{\"notice\":\"Data to be sent to the recipient address.\"},\"recipient()\":{\"notice\":\"Address that will receive Teleportr withdrawals.\"},\"setData(bytes)\":{\"notice\":\"Allows the owner to update the data to be sent to the recipient address.\"},\"setRecipient(address)\":{\"notice\":\"Allows the owner to update the recipient address.\"},\"setTeleportr(address)\":{\"notice\":\"Allows the owner to update the Teleportr contract address.\"},\"teleportr()\":{\"notice\":\"Address of the Teleportr contract.\"},\"withdrawERC20(address,address)\":{\"notice\":\"Withdraws full ERC20 balance to the recipient.\"},\"withdrawERC20(address,address,uint256)\":{\"notice\":\"Withdraws partial ERC20 balance to the recipient.\"},\"withdrawERC721(address,address,uint256)\":{\"notice\":\"Withdraws ERC721 token to the recipient.\"},\"withdrawETH(address)\":{\"notice\":\"Withdraws full ETH balance to the recipient.\"},\"withdrawETH(address,uint256)\":{\"notice\":\"Withdraws partial ETH balance to the recipient.\"},\"withdrawFromTeleportr()\":{\"notice\":\"Withdraws the full balance of the Teleportr contract to the recipient address. Anyone is allowed to trigger this function since the recipient address cannot be controlled by the msg.sender.\"}},\"notice\":\"The TeleportrWithdrawer is a simple contract capable of withdrawing funds from the TeleportrContract and sending them to some recipient address.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/universal/TeleportrWithdrawer.sol\":\"TeleportrWithdrawer\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"@rari-capital/solmate/src/auth/Owned.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity >=0.8.0;\\n\\n/// @notice Simple single owner authorization mixin.\\n/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/auth/Owned.sol)\\nabstract contract Owned {\\n /*//////////////////////////////////////////////////////////////\\n EVENTS\\n //////////////////////////////////////////////////////////////*/\\n\\n event OwnerUpdated(address indexed user, address indexed newOwner);\\n\\n /*//////////////////////////////////////////////////////////////\\n OWNERSHIP STORAGE\\n //////////////////////////////////////////////////////////////*/\\n\\n address public owner;\\n\\n modifier onlyOwner() virtual {\\n require(msg.sender == owner, \\\"UNAUTHORIZED\\\");\\n\\n _;\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n CONSTRUCTOR\\n //////////////////////////////////////////////////////////////*/\\n\\n constructor(address _owner) {\\n owner = _owner;\\n\\n emit OwnerUpdated(address(0), _owner);\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n OWNERSHIP LOGIC\\n //////////////////////////////////////////////////////////////*/\\n\\n function setOwner(address newOwner) public virtual onlyOwner {\\n owner = newOwner;\\n\\n emit OwnerUpdated(msg.sender, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0x7e91c80b0dd1a14a19cb9e661b99924043adab6d9d893bbfcf3a6a3dc23a6743\",\"license\":\"AGPL-3.0-only\"},\"@rari-capital/solmate/src/tokens/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity >=0.8.0;\\n\\n/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.\\n/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC20.sol)\\n/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)\\n/// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.\\nabstract contract ERC20 {\\n /*//////////////////////////////////////////////////////////////\\n EVENTS\\n //////////////////////////////////////////////////////////////*/\\n\\n event Transfer(address indexed from, address indexed to, uint256 amount);\\n\\n event Approval(address indexed owner, address indexed spender, uint256 amount);\\n\\n /*//////////////////////////////////////////////////////////////\\n METADATA STORAGE\\n //////////////////////////////////////////////////////////////*/\\n\\n string public name;\\n\\n string public symbol;\\n\\n uint8 public immutable decimals;\\n\\n /*//////////////////////////////////////////////////////////////\\n ERC20 STORAGE\\n //////////////////////////////////////////////////////////////*/\\n\\n uint256 public totalSupply;\\n\\n mapping(address => uint256) public balanceOf;\\n\\n mapping(address => mapping(address => uint256)) public allowance;\\n\\n /*//////////////////////////////////////////////////////////////\\n EIP-2612 STORAGE\\n //////////////////////////////////////////////////////////////*/\\n\\n uint256 internal immutable INITIAL_CHAIN_ID;\\n\\n bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR;\\n\\n mapping(address => uint256) public nonces;\\n\\n /*//////////////////////////////////////////////////////////////\\n CONSTRUCTOR\\n //////////////////////////////////////////////////////////////*/\\n\\n constructor(\\n string memory _name,\\n string memory _symbol,\\n uint8 _decimals\\n ) {\\n name = _name;\\n symbol = _symbol;\\n decimals = _decimals;\\n\\n INITIAL_CHAIN_ID = block.chainid;\\n INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator();\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n ERC20 LOGIC\\n //////////////////////////////////////////////////////////////*/\\n\\n function approve(address spender, uint256 amount) public virtual returns (bool) {\\n allowance[msg.sender][spender] = amount;\\n\\n emit Approval(msg.sender, spender, amount);\\n\\n return true;\\n }\\n\\n function transfer(address to, uint256 amount) public virtual returns (bool) {\\n balanceOf[msg.sender] -= amount;\\n\\n // Cannot overflow because the sum of all user\\n // balances can't exceed the max uint256 value.\\n unchecked {\\n balanceOf[to] += amount;\\n }\\n\\n emit Transfer(msg.sender, to, amount);\\n\\n return true;\\n }\\n\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) public virtual returns (bool) {\\n uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals.\\n\\n if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount;\\n\\n balanceOf[from] -= amount;\\n\\n // Cannot overflow because the sum of all user\\n // balances can't exceed the max uint256 value.\\n unchecked {\\n balanceOf[to] += amount;\\n }\\n\\n emit Transfer(from, to, amount);\\n\\n return true;\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n EIP-2612 LOGIC\\n //////////////////////////////////////////////////////////////*/\\n\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) public virtual {\\n require(deadline >= block.timestamp, \\\"PERMIT_DEADLINE_EXPIRED\\\");\\n\\n // Unchecked because the only math done is incrementing\\n // the owner's nonce which cannot realistically overflow.\\n unchecked {\\n address recoveredAddress = ecrecover(\\n keccak256(\\n abi.encodePacked(\\n \\\"\\\\x19\\\\x01\\\",\\n DOMAIN_SEPARATOR(),\\n keccak256(\\n abi.encode(\\n keccak256(\\n \\\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\\\"\\n ),\\n owner,\\n spender,\\n value,\\n nonces[owner]++,\\n deadline\\n )\\n )\\n )\\n ),\\n v,\\n r,\\n s\\n );\\n\\n require(recoveredAddress != address(0) && recoveredAddress == owner, \\\"INVALID_SIGNER\\\");\\n\\n allowance[recoveredAddress][spender] = value;\\n }\\n\\n emit Approval(owner, spender, value);\\n }\\n\\n function DOMAIN_SEPARATOR() public view virtual returns (bytes32) {\\n return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator();\\n }\\n\\n function computeDomainSeparator() internal view virtual returns (bytes32) {\\n return\\n keccak256(\\n abi.encode(\\n keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"),\\n keccak256(bytes(name)),\\n keccak256(\\\"1\\\"),\\n block.chainid,\\n address(this)\\n )\\n );\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n INTERNAL MINT/BURN LOGIC\\n //////////////////////////////////////////////////////////////*/\\n\\n function _mint(address to, uint256 amount) internal virtual {\\n totalSupply += amount;\\n\\n // Cannot overflow because the sum of all user\\n // balances can't exceed the max uint256 value.\\n unchecked {\\n balanceOf[to] += amount;\\n }\\n\\n emit Transfer(address(0), to, amount);\\n }\\n\\n function _burn(address from, uint256 amount) internal virtual {\\n balanceOf[from] -= amount;\\n\\n // Cannot underflow because a user's balance\\n // will never be larger than the total supply.\\n unchecked {\\n totalSupply -= amount;\\n }\\n\\n emit Transfer(from, address(0), amount);\\n }\\n}\\n\",\"keccak256\":\"0x0240f7703cff32a61ee3e9fbb339e09a944260432a9ef37debf3692b1a6c8049\",\"license\":\"AGPL-3.0-only\"},\"@rari-capital/solmate/src/tokens/ERC721.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity >=0.8.0;\\n\\n/// @notice Modern, minimalist, and gas efficient ERC-721 implementation.\\n/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC721.sol)\\nabstract contract ERC721 {\\n /*//////////////////////////////////////////////////////////////\\n EVENTS\\n //////////////////////////////////////////////////////////////*/\\n\\n event Transfer(address indexed from, address indexed to, uint256 indexed id);\\n\\n event Approval(address indexed owner, address indexed spender, uint256 indexed id);\\n\\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\\n\\n /*//////////////////////////////////////////////////////////////\\n METADATA STORAGE/LOGIC\\n //////////////////////////////////////////////////////////////*/\\n\\n string public name;\\n\\n string public symbol;\\n\\n function tokenURI(uint256 id) public view virtual returns (string memory);\\n\\n /*//////////////////////////////////////////////////////////////\\n ERC721 BALANCE/OWNER STORAGE\\n //////////////////////////////////////////////////////////////*/\\n\\n mapping(uint256 => address) internal _ownerOf;\\n\\n mapping(address => uint256) internal _balanceOf;\\n\\n function ownerOf(uint256 id) public view virtual returns (address owner) {\\n require((owner = _ownerOf[id]) != address(0), \\\"NOT_MINTED\\\");\\n }\\n\\n function balanceOf(address owner) public view virtual returns (uint256) {\\n require(owner != address(0), \\\"ZERO_ADDRESS\\\");\\n\\n return _balanceOf[owner];\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n ERC721 APPROVAL STORAGE\\n //////////////////////////////////////////////////////////////*/\\n\\n mapping(uint256 => address) public getApproved;\\n\\n mapping(address => mapping(address => bool)) public isApprovedForAll;\\n\\n /*//////////////////////////////////////////////////////////////\\n CONSTRUCTOR\\n //////////////////////////////////////////////////////////////*/\\n\\n constructor(string memory _name, string memory _symbol) {\\n name = _name;\\n symbol = _symbol;\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n ERC721 LOGIC\\n //////////////////////////////////////////////////////////////*/\\n\\n function approve(address spender, uint256 id) public virtual {\\n address owner = _ownerOf[id];\\n\\n require(msg.sender == owner || isApprovedForAll[owner][msg.sender], \\\"NOT_AUTHORIZED\\\");\\n\\n getApproved[id] = spender;\\n\\n emit Approval(owner, spender, id);\\n }\\n\\n function setApprovalForAll(address operator, bool approved) public virtual {\\n isApprovedForAll[msg.sender][operator] = approved;\\n\\n emit ApprovalForAll(msg.sender, operator, approved);\\n }\\n\\n function transferFrom(\\n address from,\\n address to,\\n uint256 id\\n ) public virtual {\\n require(from == _ownerOf[id], \\\"WRONG_FROM\\\");\\n\\n require(to != address(0), \\\"INVALID_RECIPIENT\\\");\\n\\n require(\\n msg.sender == from || isApprovedForAll[from][msg.sender] || msg.sender == getApproved[id],\\n \\\"NOT_AUTHORIZED\\\"\\n );\\n\\n // Underflow of the sender's balance is impossible because we check for\\n // ownership above and the recipient's balance can't realistically overflow.\\n unchecked {\\n _balanceOf[from]--;\\n\\n _balanceOf[to]++;\\n }\\n\\n _ownerOf[id] = to;\\n\\n delete getApproved[id];\\n\\n emit Transfer(from, to, id);\\n }\\n\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 id\\n ) public virtual {\\n transferFrom(from, to, id);\\n\\n require(\\n to.code.length == 0 ||\\n ERC721TokenReceiver(to).onERC721Received(msg.sender, from, id, \\\"\\\") ==\\n ERC721TokenReceiver.onERC721Received.selector,\\n \\\"UNSAFE_RECIPIENT\\\"\\n );\\n }\\n\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 id,\\n bytes calldata data\\n ) public virtual {\\n transferFrom(from, to, id);\\n\\n require(\\n to.code.length == 0 ||\\n ERC721TokenReceiver(to).onERC721Received(msg.sender, from, id, data) ==\\n ERC721TokenReceiver.onERC721Received.selector,\\n \\\"UNSAFE_RECIPIENT\\\"\\n );\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n ERC165 LOGIC\\n //////////////////////////////////////////////////////////////*/\\n\\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\\n return\\n interfaceId == 0x01ffc9a7 || // ERC165 Interface ID for ERC165\\n interfaceId == 0x80ac58cd || // ERC165 Interface ID for ERC721\\n interfaceId == 0x5b5e139f; // ERC165 Interface ID for ERC721Metadata\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n INTERNAL MINT/BURN LOGIC\\n //////////////////////////////////////////////////////////////*/\\n\\n function _mint(address to, uint256 id) internal virtual {\\n require(to != address(0), \\\"INVALID_RECIPIENT\\\");\\n\\n require(_ownerOf[id] == address(0), \\\"ALREADY_MINTED\\\");\\n\\n // Counter overflow is incredibly unrealistic.\\n unchecked {\\n _balanceOf[to]++;\\n }\\n\\n _ownerOf[id] = to;\\n\\n emit Transfer(address(0), to, id);\\n }\\n\\n function _burn(uint256 id) internal virtual {\\n address owner = _ownerOf[id];\\n\\n require(owner != address(0), \\\"NOT_MINTED\\\");\\n\\n // Ownership check above ensures no underflow.\\n unchecked {\\n _balanceOf[owner]--;\\n }\\n\\n delete _ownerOf[id];\\n\\n delete getApproved[id];\\n\\n emit Transfer(owner, address(0), id);\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n INTERNAL SAFE MINT LOGIC\\n //////////////////////////////////////////////////////////////*/\\n\\n function _safeMint(address to, uint256 id) internal virtual {\\n _mint(to, id);\\n\\n require(\\n to.code.length == 0 ||\\n ERC721TokenReceiver(to).onERC721Received(msg.sender, address(0), id, \\\"\\\") ==\\n ERC721TokenReceiver.onERC721Received.selector,\\n \\\"UNSAFE_RECIPIENT\\\"\\n );\\n }\\n\\n function _safeMint(\\n address to,\\n uint256 id,\\n bytes memory data\\n ) internal virtual {\\n _mint(to, id);\\n\\n require(\\n to.code.length == 0 ||\\n ERC721TokenReceiver(to).onERC721Received(msg.sender, address(0), id, data) ==\\n ERC721TokenReceiver.onERC721Received.selector,\\n \\\"UNSAFE_RECIPIENT\\\"\\n );\\n }\\n}\\n\\n/// @notice A generic interface for a contract which properly accepts ERC721 tokens.\\n/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC721.sol)\\nabstract contract ERC721TokenReceiver {\\n function onERC721Received(\\n address,\\n address,\\n uint256,\\n bytes calldata\\n ) external virtual returns (bytes4) {\\n return ERC721TokenReceiver.onERC721Received.selector;\\n }\\n}\\n\",\"keccak256\":\"0xb59c7c25eca386f39da4819a9f70f89b73b7583d5f5127a83ffe5339800b1183\",\"license\":\"AGPL-3.0-only\"},\"contracts/universal/AssetReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.9;\\n\\nimport { ERC20 } from \\\"@rari-capital/solmate/src/tokens/ERC20.sol\\\";\\nimport { ERC721 } from \\\"@rari-capital/solmate/src/tokens/ERC721.sol\\\";\\nimport { Transactor } from \\\"./Transactor.sol\\\";\\n\\n/**\\n * @title AssetReceiver\\n * @notice AssetReceiver is a minimal contract for receiving funds assets in the form of either\\n * ETH, ERC20 tokens, or ERC721 tokens. Only the contract owner may withdraw the assets.\\n */\\ncontract AssetReceiver is Transactor {\\n /**\\n * Emitted when ETH is received by this address.\\n */\\n event ReceivedETH(address indexed from, uint256 amount);\\n\\n /**\\n * Emitted when ETH is withdrawn from this address.\\n */\\n event WithdrewETH(address indexed withdrawer, address indexed recipient, uint256 amount);\\n\\n /**\\n * Emitted when ERC20 tokens are withdrawn from this address.\\n */\\n event WithdrewERC20(\\n address indexed withdrawer,\\n address indexed recipient,\\n address indexed asset,\\n uint256 amount\\n );\\n\\n /**\\n * Emitted when ERC721 tokens are withdrawn from this address.\\n */\\n event WithdrewERC721(\\n address indexed withdrawer,\\n address indexed recipient,\\n address indexed asset,\\n uint256 id\\n );\\n\\n /**\\n * @param _owner Initial contract owner.\\n */\\n constructor(address _owner) Transactor(_owner) {}\\n\\n /**\\n * Make sure we can receive ETH.\\n */\\n receive() external payable {\\n emit ReceivedETH(msg.sender, msg.value);\\n }\\n\\n /**\\n * Withdraws full ETH balance to the recipient.\\n *\\n * @param _to Address to receive the ETH balance.\\n */\\n function withdrawETH(address payable _to) external onlyOwner {\\n withdrawETH(_to, address(this).balance);\\n }\\n\\n /**\\n * Withdraws partial ETH balance to the recipient.\\n *\\n * @param _to Address to receive the ETH balance.\\n * @param _amount Amount of ETH to withdraw.\\n */\\n function withdrawETH(address payable _to, uint256 _amount) public onlyOwner {\\n // slither-disable-next-line reentrancy-unlimited-gas\\n _to.transfer(_amount);\\n emit WithdrewETH(msg.sender, _to, _amount);\\n }\\n\\n /**\\n * Withdraws full ERC20 balance to the recipient.\\n *\\n * @param _asset ERC20 token to withdraw.\\n * @param _to Address to receive the ERC20 balance.\\n */\\n function withdrawERC20(ERC20 _asset, address _to) external onlyOwner {\\n withdrawERC20(_asset, _to, _asset.balanceOf(address(this)));\\n }\\n\\n /**\\n * Withdraws partial ERC20 balance to the recipient.\\n *\\n * @param _asset ERC20 token to withdraw.\\n * @param _to Address to receive the ERC20 balance.\\n * @param _amount Amount of ERC20 to withdraw.\\n */\\n function withdrawERC20(\\n ERC20 _asset,\\n address _to,\\n uint256 _amount\\n ) public onlyOwner {\\n // slither-disable-next-line unchecked-transfer\\n _asset.transfer(_to, _amount);\\n // slither-disable-next-line reentrancy-events\\n emit WithdrewERC20(msg.sender, _to, address(_asset), _amount);\\n }\\n\\n /**\\n * Withdraws ERC721 token to the recipient.\\n *\\n * @param _asset ERC721 token to withdraw.\\n * @param _to Address to receive the ERC721 token.\\n * @param _id Token ID of the ERC721 token to withdraw.\\n */\\n function withdrawERC721(\\n ERC721 _asset,\\n address _to,\\n uint256 _id\\n ) external onlyOwner {\\n _asset.transferFrom(address(this), _to, _id);\\n // slither-disable-next-line reentrancy-events\\n emit WithdrewERC721(msg.sender, _to, address(_asset), _id);\\n }\\n}\\n\",\"keccak256\":\"0x1f82aff6f4e5a4bebebbfb4a2e0e4378ef9bc5bee8b81f88b27fc0ce73546d5f\",\"license\":\"MIT\"},\"contracts/universal/TeleportrWithdrawer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.9;\\n\\nimport { AssetReceiver } from \\\"./AssetReceiver.sol\\\";\\n\\n/**\\n * @notice Stub interface for Teleportr.\\n */\\ninterface Teleportr {\\n function withdrawBalance() external;\\n}\\n\\n/**\\n * @title TeleportrWithdrawer\\n * @notice The TeleportrWithdrawer is a simple contract capable of withdrawing funds from the\\n * TeleportrContract and sending them to some recipient address.\\n */\\ncontract TeleportrWithdrawer is AssetReceiver {\\n /**\\n * @notice Address of the Teleportr contract.\\n */\\n address public teleportr;\\n\\n /**\\n * @notice Address that will receive Teleportr withdrawals.\\n */\\n address public recipient;\\n\\n /**\\n * @notice Data to be sent to the recipient address.\\n */\\n bytes public data;\\n\\n /**\\n * @param _owner Initial owner of the contract.\\n */\\n constructor(address _owner) AssetReceiver(_owner) {}\\n\\n /**\\n * @notice Allows the owner to update the recipient address.\\n *\\n * @param _recipient New recipient address.\\n */\\n function setRecipient(address _recipient) external onlyOwner {\\n recipient = _recipient;\\n }\\n\\n /**\\n * @notice Allows the owner to update the Teleportr contract address.\\n *\\n * @param _teleportr New Teleportr contract address.\\n */\\n function setTeleportr(address _teleportr) external onlyOwner {\\n teleportr = _teleportr;\\n }\\n\\n /**\\n * @notice Allows the owner to update the data to be sent to the recipient address.\\n *\\n * @param _data New data to be sent to the recipient address.\\n */\\n function setData(bytes memory _data) external onlyOwner {\\n data = _data;\\n }\\n\\n /**\\n * @notice Withdraws the full balance of the Teleportr contract to the recipient address.\\n * Anyone is allowed to trigger this function since the recipient address cannot be\\n * controlled by the msg.sender.\\n */\\n function withdrawFromTeleportr() external {\\n Teleportr(teleportr).withdrawBalance();\\n (bool success, ) = recipient.call{ value: address(this).balance }(data);\\n require(success, \\\"TeleportrWithdrawer: send failed\\\");\\n }\\n}\\n\",\"keccak256\":\"0x26414ae14c7aee927c18075ee60757383e0202c2a2691f23b86c200c0ac24713\",\"license\":\"MIT\"},\"contracts/universal/Transactor.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.9;\\n\\nimport { Owned } from \\\"@rari-capital/solmate/src/auth/Owned.sol\\\";\\n\\n/**\\n * @title Transactor\\n * @notice Transactor is a minimal contract that can send transactions.\\n */\\ncontract Transactor is Owned {\\n /**\\n * @param _owner Initial contract owner.\\n */\\n constructor(address _owner) Owned(_owner) {}\\n\\n /**\\n * Sends a CALL to a target address.\\n *\\n * @param _target Address to call.\\n * @param _data Data to send with the call.\\n * @param _gas Amount of gas to send with the call.\\n * @param _value ETH value to send with the call.\\n * @return Boolean success value.\\n * @return Bytes data returned by the call.\\n */\\n function CALL(\\n address _target,\\n bytes memory _data,\\n uint256 _gas,\\n uint256 _value\\n ) external payable onlyOwner returns (bool, bytes memory) {\\n return _target.call{ gas: _gas, value: _value }(_data);\\n }\\n\\n /**\\n * Sends a DELEGATECALL to a target address.\\n *\\n * @param _target Address to call.\\n * @param _data Data to send with the call.\\n * @param _gas Amount of gas to send with the call.\\n * @return Boolean success value.\\n * @return Bytes data returned by the call.\\n */\\n function DELEGATECALL(\\n address _target,\\n bytes memory _data,\\n uint256 _gas\\n ) external payable onlyOwner returns (bool, bytes memory) {\\n // slither-disable-next-line controlled-delegatecall\\n return _target.delegatecall{ gas: _gas }(_data);\\n }\\n}\\n\",\"keccak256\":\"0xfe0d9c05a423d36775047e3285f76b874f8b887444d412a0d680c302c3b06a50\",\"license\":\"MIT\"}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b506040516115ac3803806115ac83398101604081905261002f91610086565b600080546001600160a01b0319166001600160a01b03831690811782556040518392839283929091907f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d76908290a3505050506100b6565b60006020828403121561009857600080fd5b81516001600160a01b03811681146100af57600080fd5b9392505050565b6114e7806100c56000396000f3fe6080604052600436106100f75760003560e01c8063617d55421161008a5780638da5cb5b116100595780638da5cb5b146102f65780639456fbcc146103235780639e73dbea14610343578063ab62f0e11461035657600080fd5b8063617d55421461026757806366d003ac14610287578063690d8320146102b457806373d4a13a146102d457600080fd5b80634025feb2116100c65780634025feb2146101e657806344004cc1146102065780634782f779146102265780635cef8b4a1461024657600080fd5b806306fa29b21461013857806313af40351461018f5780633afe48c2146101b15780633bbed4a0146101c657600080fd5b366101335760405134815233907f4103257eaac983ca79a70d28f90dfc4fa16b619bb0c17ee7cab0d4034c2796249060200160405180910390a2005b600080fd5b34801561014457600080fd5b506001546101659073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b34801561019b57600080fd5b506101af6101aa366004610ff1565b610376565b005b3480156101bd57600080fd5b506101af610452565b3480156101d257600080fd5b506101af6101e1366004610ff1565b61059a565b3480156101f257600080fd5b506101af610201366004611015565b610648565b34801561021257600080fd5b506101af610221366004611015565b6107c0565b34801561023257600080fd5b506101af610241366004611056565b610946565b61025961025436600461115c565b610a42565b60405161018692919061122f565b34801561027357600080fd5b506101af610282366004610ff1565b610b21565b34801561029357600080fd5b506002546101659073ffffffffffffffffffffffffffffffffffffffff1681565b3480156102c057600080fd5b506101af6102cf366004610ff1565b610bcf565b3480156102e057600080fd5b506102e9610c40565b6040516101869190611252565b34801561030257600080fd5b506000546101659073ffffffffffffffffffffffffffffffffffffffff1681565b34801561032f57600080fd5b506101af61033e366004611265565b610cce565b61025961035136600461129e565b610dde565b34801561036257600080fd5b506101af6103713660046112fe565b610ec1565b60005473ffffffffffffffffffffffffffffffffffffffff1633146103e25760405162461bcd60e51b815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064015b60405180910390fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081178255604051909133917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d769190a350565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635fd8c7106040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156104bc57600080fd5b505af11580156104d0573d6000803e3d6000fd5b50506002546040516000935073ffffffffffffffffffffffffffffffffffffffff9091169150479061050490600390611387565b60006040518083038185875af1925050503d8060008114610541576040519150601f19603f3d011682016040523d82523d6000602084013e610546565b606091505b50509050806105975760405162461bcd60e51b815260206004820181905260248201527f54656c65706f727472576974686472617765723a2073656e64206661696c656460448201526064016103d9565b50565b60005473ffffffffffffffffffffffffffffffffffffffff1633146106015760405162461bcd60e51b815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016103d9565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60005473ffffffffffffffffffffffffffffffffffffffff1633146106af5760405162461bcd60e51b815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016103d9565b6040517f23b872dd00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8381166024830152604482018390528416906323b872dd90606401600060405180830381600087803b15801561072557600080fd5b505af1158015610739573d6000803e3d6000fd5b505050508273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f30b478a5e196e55886228aa87ba74a7dfeba655e0a4d7ba275eabfc22aabb7a8846040516107b391815260200190565b60405180910390a4505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146108275760405162461bcd60e51b815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016103d9565b6040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301526024820183905284169063a9059cbb90604401602060405180830381600087803b15801561089757600080fd5b505af11580156108ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108cf919061145a565b508273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f6b00f1c7883f053ba83e907fd1965b22fffe3c4111383e725f04638a566cdbfa846040516107b391815260200190565b60005473ffffffffffffffffffffffffffffffffffffffff1633146109ad5760405162461bcd60e51b815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016103d9565b60405173ffffffffffffffffffffffffffffffffffffffff83169082156108fc029083906000818181858888f193505050501580156109f0573d6000803e3d6000fd5b5060405181815273ffffffffffffffffffffffffffffffffffffffff83169033907f1f12aa8b6d492dd9b98e2b00b0b20830c2a7ded65afac13b60d169a034ae90bc9060200160405180910390a35050565b6000805460609073ffffffffffffffffffffffffffffffffffffffff163314610aad5760405162461bcd60e51b815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016103d9565b8473ffffffffffffffffffffffffffffffffffffffff168385604051610ad3919061147c565b6000604051808303818686f4925050503d8060008114610b0f576040519150601f19603f3d011682016040523d82523d6000602084013e610b14565b606091505b5091509150935093915050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610b885760405162461bcd60e51b815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016103d9565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60005473ffffffffffffffffffffffffffffffffffffffff163314610c365760405162461bcd60e51b815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016103d9565b6105978147610946565b60038054610c4d90611333565b80601f0160208091040260200160405190810160405280929190818152602001828054610c7990611333565b8015610cc65780601f10610c9b57610100808354040283529160200191610cc6565b820191906000526020600020905b815481529060010190602001808311610ca957829003601f168201915b505050505081565b60005473ffffffffffffffffffffffffffffffffffffffff163314610d355760405162461bcd60e51b815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016103d9565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152610dda908390839073ffffffffffffffffffffffffffffffffffffffff8316906370a082319060240160206040518083038186803b158015610da257600080fd5b505afa158015610db6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102219190611498565b5050565b6000805460609073ffffffffffffffffffffffffffffffffffffffff163314610e495760405162461bcd60e51b815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016103d9565b8573ffffffffffffffffffffffffffffffffffffffff16848487604051610e70919061147c565b600060405180830381858888f193505050503d8060008114610eae576040519150601f19603f3d011682016040523d82523d6000602084013e610eb3565b606091505b509150915094509492505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610f285760405162461bcd60e51b815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016103d9565b8051610dda906003906020840190828054610f4290611333565b90600052602060002090601f016020900481019282610f645760008555610faa565b82601f10610f7d57805160ff1916838001178555610faa565b82800160010185558215610faa579182015b82811115610faa578251825591602001919060010190610f8f565b50610fb6929150610fba565b5090565b5b80821115610fb65760008155600101610fbb565b73ffffffffffffffffffffffffffffffffffffffff8116811461059757600080fd5b60006020828403121561100357600080fd5b813561100e81610fcf565b9392505050565b60008060006060848603121561102a57600080fd5b833561103581610fcf565b9250602084013561104581610fcf565b929592945050506040919091013590565b6000806040838503121561106957600080fd5b823561107481610fcf565b946020939093013593505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f8301126110c257600080fd5b813567ffffffffffffffff808211156110dd576110dd611082565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171561112357611123611082565b8160405283815286602085880101111561113c57600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060006060848603121561117157600080fd5b833561117c81610fcf565b9250602084013567ffffffffffffffff81111561119857600080fd5b6111a4868287016110b1565b925050604084013590509250925092565b60005b838110156111d05781810151838201526020016111b8565b838111156111df576000848401525b50505050565b600081518084526111fd8160208601602086016111b5565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b821515815260406020820152600061124a60408301846111e5565b949350505050565b60208152600061100e60208301846111e5565b6000806040838503121561127857600080fd5b823561128381610fcf565b9150602083013561129381610fcf565b809150509250929050565b600080600080608085870312156112b457600080fd5b84356112bf81610fcf565b9350602085013567ffffffffffffffff8111156112db57600080fd5b6112e7878288016110b1565b949794965050505060408301359260600135919050565b60006020828403121561131057600080fd5b813567ffffffffffffffff81111561132757600080fd5b61124a848285016110b1565b600181811c9082168061134757607f821691505b60208210811415611381577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b600080835481600182811c9150808316806113a357607f831692505b60208084108214156113dc577f4e487b710000000000000000000000000000000000000000000000000000000086526022600452602486fd5b8180156113f0576001811461141f5761144c565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0086168952848901965061144c565b60008a81526020902060005b868110156114445781548b82015290850190830161142b565b505084890196505b509498975050505050505050565b60006020828403121561146c57600080fd5b8151801515811461100e57600080fd5b6000825161148e8184602087016111b5565b9190910192915050565b6000602082840312156114aa57600080fd5b505191905056fea26469706673582212203903a2f3f310c1942ac6f552df9012c64af2d384894531650c63a359397535f364736f6c63430008090033",
"deployedBytecode": "0x6080604052600436106100f75760003560e01c8063617d55421161008a5780638da5cb5b116100595780638da5cb5b146102f65780639456fbcc146103235780639e73dbea14610343578063ab62f0e11461035657600080fd5b8063617d55421461026757806366d003ac14610287578063690d8320146102b457806373d4a13a146102d457600080fd5b80634025feb2116100c65780634025feb2146101e657806344004cc1146102065780634782f779146102265780635cef8b4a1461024657600080fd5b806306fa29b21461013857806313af40351461018f5780633afe48c2146101b15780633bbed4a0146101c657600080fd5b366101335760405134815233907f4103257eaac983ca79a70d28f90dfc4fa16b619bb0c17ee7cab0d4034c2796249060200160405180910390a2005b600080fd5b34801561014457600080fd5b506001546101659073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b34801561019b57600080fd5b506101af6101aa366004610ff1565b610376565b005b3480156101bd57600080fd5b506101af610452565b3480156101d257600080fd5b506101af6101e1366004610ff1565b61059a565b3480156101f257600080fd5b506101af610201366004611015565b610648565b34801561021257600080fd5b506101af610221366004611015565b6107c0565b34801561023257600080fd5b506101af610241366004611056565b610946565b61025961025436600461115c565b610a42565b60405161018692919061122f565b34801561027357600080fd5b506101af610282366004610ff1565b610b21565b34801561029357600080fd5b506002546101659073ffffffffffffffffffffffffffffffffffffffff1681565b3480156102c057600080fd5b506101af6102cf366004610ff1565b610bcf565b3480156102e057600080fd5b506102e9610c40565b6040516101869190611252565b34801561030257600080fd5b506000546101659073ffffffffffffffffffffffffffffffffffffffff1681565b34801561032f57600080fd5b506101af61033e366004611265565b610cce565b61025961035136600461129e565b610dde565b34801561036257600080fd5b506101af6103713660046112fe565b610ec1565b60005473ffffffffffffffffffffffffffffffffffffffff1633146103e25760405162461bcd60e51b815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064015b60405180910390fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081178255604051909133917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d769190a350565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635fd8c7106040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156104bc57600080fd5b505af11580156104d0573d6000803e3d6000fd5b50506002546040516000935073ffffffffffffffffffffffffffffffffffffffff9091169150479061050490600390611387565b60006040518083038185875af1925050503d8060008114610541576040519150601f19603f3d011682016040523d82523d6000602084013e610546565b606091505b50509050806105975760405162461bcd60e51b815260206004820181905260248201527f54656c65706f727472576974686472617765723a2073656e64206661696c656460448201526064016103d9565b50565b60005473ffffffffffffffffffffffffffffffffffffffff1633146106015760405162461bcd60e51b815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016103d9565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60005473ffffffffffffffffffffffffffffffffffffffff1633146106af5760405162461bcd60e51b815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016103d9565b6040517f23b872dd00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8381166024830152604482018390528416906323b872dd90606401600060405180830381600087803b15801561072557600080fd5b505af1158015610739573d6000803e3d6000fd5b505050508273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f30b478a5e196e55886228aa87ba74a7dfeba655e0a4d7ba275eabfc22aabb7a8846040516107b391815260200190565b60405180910390a4505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146108275760405162461bcd60e51b815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016103d9565b6040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301526024820183905284169063a9059cbb90604401602060405180830381600087803b15801561089757600080fd5b505af11580156108ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108cf919061145a565b508273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f6b00f1c7883f053ba83e907fd1965b22fffe3c4111383e725f04638a566cdbfa846040516107b391815260200190565b60005473ffffffffffffffffffffffffffffffffffffffff1633146109ad5760405162461bcd60e51b815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016103d9565b60405173ffffffffffffffffffffffffffffffffffffffff83169082156108fc029083906000818181858888f193505050501580156109f0573d6000803e3d6000fd5b5060405181815273ffffffffffffffffffffffffffffffffffffffff83169033907f1f12aa8b6d492dd9b98e2b00b0b20830c2a7ded65afac13b60d169a034ae90bc9060200160405180910390a35050565b6000805460609073ffffffffffffffffffffffffffffffffffffffff163314610aad5760405162461bcd60e51b815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016103d9565b8473ffffffffffffffffffffffffffffffffffffffff168385604051610ad3919061147c565b6000604051808303818686f4925050503d8060008114610b0f576040519150601f19603f3d011682016040523d82523d6000602084013e610b14565b606091505b5091509150935093915050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610b885760405162461bcd60e51b815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016103d9565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60005473ffffffffffffffffffffffffffffffffffffffff163314610c365760405162461bcd60e51b815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016103d9565b6105978147610946565b60038054610c4d90611333565b80601f0160208091040260200160405190810160405280929190818152602001828054610c7990611333565b8015610cc65780601f10610c9b57610100808354040283529160200191610cc6565b820191906000526020600020905b815481529060010190602001808311610ca957829003601f168201915b505050505081565b60005473ffffffffffffffffffffffffffffffffffffffff163314610d355760405162461bcd60e51b815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016103d9565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152610dda908390839073ffffffffffffffffffffffffffffffffffffffff8316906370a082319060240160206040518083038186803b158015610da257600080fd5b505afa158015610db6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102219190611498565b5050565b6000805460609073ffffffffffffffffffffffffffffffffffffffff163314610e495760405162461bcd60e51b815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016103d9565b8573ffffffffffffffffffffffffffffffffffffffff16848487604051610e70919061147c565b600060405180830381858888f193505050503d8060008114610eae576040519150601f19603f3d011682016040523d82523d6000602084013e610eb3565b606091505b509150915094509492505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610f285760405162461bcd60e51b815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064016103d9565b8051610dda906003906020840190828054610f4290611333565b90600052602060002090601f016020900481019282610f645760008555610faa565b82601f10610f7d57805160ff1916838001178555610faa565b82800160010185558215610faa579182015b82811115610faa578251825591602001919060010190610f8f565b50610fb6929150610fba565b5090565b5b80821115610fb65760008155600101610fbb565b73ffffffffffffffffffffffffffffffffffffffff8116811461059757600080fd5b60006020828403121561100357600080fd5b813561100e81610fcf565b9392505050565b60008060006060848603121561102a57600080fd5b833561103581610fcf565b9250602084013561104581610fcf565b929592945050506040919091013590565b6000806040838503121561106957600080fd5b823561107481610fcf565b946020939093013593505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f8301126110c257600080fd5b813567ffffffffffffffff808211156110dd576110dd611082565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171561112357611123611082565b8160405283815286602085880101111561113c57600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060006060848603121561117157600080fd5b833561117c81610fcf565b9250602084013567ffffffffffffffff81111561119857600080fd5b6111a4868287016110b1565b925050604084013590509250925092565b60005b838110156111d05781810151838201526020016111b8565b838111156111df576000848401525b50505050565b600081518084526111fd8160208601602086016111b5565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b821515815260406020820152600061124a60408301846111e5565b949350505050565b60208152600061100e60208301846111e5565b6000806040838503121561127857600080fd5b823561128381610fcf565b9150602083013561129381610fcf565b809150509250929050565b600080600080608085870312156112b457600080fd5b84356112bf81610fcf565b9350602085013567ffffffffffffffff8111156112db57600080fd5b6112e7878288016110b1565b949794965050505060408301359260600135919050565b60006020828403121561131057600080fd5b813567ffffffffffffffff81111561132757600080fd5b61124a848285016110b1565b600181811c9082168061134757607f821691505b60208210811415611381577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b600080835481600182811c9150808316806113a357607f831692505b60208084108214156113dc577f4e487b710000000000000000000000000000000000000000000000000000000086526022600452602486fd5b8180156113f0576001811461141f5761144c565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0086168952848901965061144c565b60008a81526020902060005b868110156114445781548b82015290850190830161142b565b505084890196505b509498975050505050505050565b60006020828403121561146c57600080fd5b8151801515811461100e57600080fd5b6000825161148e8184602087016111b5565b9190910192915050565b6000602082840312156114aa57600080fd5b505191905056fea26469706673582212203903a2f3f310c1942ac6f552df9012c64af2d384894531650c63a359397535f364736f6c63430008090033",
"devdoc": {
"kind": "dev",
"methods": {
"CALL(address,bytes,uint256,uint256)": {
"params": {
"_data": "Data to send with the call.",
"_gas": "Amount of gas to send with the call.",
"_target": "Address to call.",
"_value": "ETH value to send with the call."
},
"returns": {
"_0": "Boolean success value.",
"_1": "Bytes data returned by the call."
}
},
"DELEGATECALL(address,bytes,uint256)": {
"params": {
"_data": "Data to send with the call.",
"_gas": "Amount of gas to send with the call.",
"_target": "Address to call."
},
"returns": {
"_0": "Boolean success value.",
"_1": "Bytes data returned by the call."
}
},
"constructor": {
"params": {
"_owner": "Initial owner of the contract."
}
},
"setData(bytes)": {
"params": {
"_data": "New data to be sent to the recipient address."
}
},
"setRecipient(address)": {
"params": {
"_recipient": "New recipient address."
}
},
"setTeleportr(address)": {
"params": {
"_teleportr": "New Teleportr contract address."
}
},
"withdrawERC20(address,address)": {
"params": {
"_asset": "ERC20 token to withdraw.",
"_to": "Address to receive the ERC20 balance."
}
},
"withdrawERC20(address,address,uint256)": {
"params": {
"_amount": "Amount of ERC20 to withdraw.",
"_asset": "ERC20 token to withdraw.",
"_to": "Address to receive the ERC20 balance."
}
},
"withdrawERC721(address,address,uint256)": {
"params": {
"_asset": "ERC721 token to withdraw.",
"_id": "Token ID of the ERC721 token to withdraw.",
"_to": "Address to receive the ERC721 token."
}
},
"withdrawETH(address)": {
"params": {
"_to": "Address to receive the ETH balance."
}
},
"withdrawETH(address,uint256)": {
"params": {
"_amount": "Amount of ETH to withdraw.",
"_to": "Address to receive the ETH balance."
}
}
},
"title": "TeleportrWithdrawer",
"version": 1
},
"userdoc": {
"events": {
"ReceivedETH(address,uint256)": {
"notice": "Emitted when ETH is received by this address."
},
"WithdrewERC20(address,address,address,uint256)": {
"notice": "Emitted when ERC20 tokens are withdrawn from this address."
},
"WithdrewERC721(address,address,address,uint256)": {
"notice": "Emitted when ERC721 tokens are withdrawn from this address."
},
"WithdrewETH(address,address,uint256)": {
"notice": "Emitted when ETH is withdrawn from this address."
}
},
"kind": "user",
"methods": {
"CALL(address,bytes,uint256,uint256)": {
"notice": "Sends a CALL to a target address."
},
"DELEGATECALL(address,bytes,uint256)": {
"notice": "Sends a DELEGATECALL to a target address."
},
"data()": {
"notice": "Data to be sent to the recipient address."
},
"recipient()": {
"notice": "Address that will receive Teleportr withdrawals."
},
"setData(bytes)": {
"notice": "Allows the owner to update the data to be sent to the recipient address."
},
"setRecipient(address)": {
"notice": "Allows the owner to update the recipient address."
},
"setTeleportr(address)": {
"notice": "Allows the owner to update the Teleportr contract address."
},
"teleportr()": {
"notice": "Address of the Teleportr contract."
},
"withdrawERC20(address,address)": {
"notice": "Withdraws full ERC20 balance to the recipient."
},
"withdrawERC20(address,address,uint256)": {
"notice": "Withdraws partial ERC20 balance to the recipient."
},
"withdrawERC721(address,address,uint256)": {
"notice": "Withdraws ERC721 token to the recipient."
},
"withdrawETH(address)": {
"notice": "Withdraws full ETH balance to the recipient."
},
"withdrawETH(address,uint256)": {
"notice": "Withdraws partial ETH balance to the recipient."
},
"withdrawFromTeleportr()": {
"notice": "Withdraws the full balance of the Teleportr contract to the recipient address. Anyone is allowed to trigger this function since the recipient address cannot be controlled by the msg.sender."
}
},
"notice": "The TeleportrWithdrawer is a simple contract capable of withdrawing funds from the TeleportrContract and sending them to some recipient address.",
"version": 1
},
"storageLayout": {
"storage": [
{
"astId": 4371,
"contract": "contracts/universal/TeleportrWithdrawer.sol:TeleportrWithdrawer",
"label": "owner",
"offset": 0,
"slot": "0",
"type": "t_address"
},
{
"astId": 6314,
"contract": "contracts/universal/TeleportrWithdrawer.sol:TeleportrWithdrawer",
"label": "teleportr",
"offset": 0,
"slot": "1",
"type": "t_address"
},
{
"astId": 6317,
"contract": "contracts/universal/TeleportrWithdrawer.sol:TeleportrWithdrawer",
"label": "recipient",
"offset": 0,
"slot": "2",
"type": "t_address"
},
{
"astId": 6320,
"contract": "contracts/universal/TeleportrWithdrawer.sol:TeleportrWithdrawer",
"label": "data",
"offset": 0,
"slot": "3",
"type": "t_bytes_storage"
}
],
"types": {
"t_address": {
"encoding": "inplace",
"label": "address",
"numberOfBytes": "20"
},
"t_bytes_storage": {
"encoding": "bytes",
"label": "bytes",
"numberOfBytes": "32"
}
}
}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -109,3 +109,19 @@ export const parseDrippieConfig = async ( ...@@ -109,3 +109,19 @@ export const parseDrippieConfig = async (
return parsed as Required<DrippieConfig> return parsed as Required<DrippieConfig>
} }
export const isSameConfig = (a: DripConfig, b: DripConfig): boolean => {
return (
a.dripcheck.toLowerCase() === b.dripcheck.toLowerCase() &&
a.checkparams === b.checkparams &&
ethers.BigNumber.from(a.interval).eq(b.interval) &&
a.actions.length === b.actions.length &&
a.actions.every((ax, i) => {
return (
ax.target === b.actions[i].target &&
ax.data === b.actions[i].data &&
ethers.BigNumber.from(ax.value).eq(b.actions[i].value)
)
})
)
}
import { ethers } from 'ethers'
// Slightly modified from:
// https://github.com/safe-global/safe-react-apps/blob/development/apps/tx-builder/src/lib/checksum.ts
const stringifyReplacer = (_: string, value: any) =>
value === undefined ? null : value
const serializeJSONObject = (json: any): string => {
if (Array.isArray(json)) {
return `[${json.map((el) => serializeJSONObject(el)).join(',')}]`
}
if (typeof json === 'object' && json !== null) {
let acc = ''
const keys = Object.keys(json).sort()
acc += `{${JSON.stringify(keys, stringifyReplacer)}`
for (const key of keys) {
acc += `${serializeJSONObject(json[key])},`
}
return `${acc}}`
}
return `${JSON.stringify(json, stringifyReplacer)}`
}
const calculateChecksum = (batchFile: any): string | undefined => {
const serialized = serializeJSONObject({
...batchFile,
meta: { ...batchFile.meta, name: null },
})
const sha = ethers.utils.solidityKeccak256(['string'], [serialized])
return sha || undefined
}
export const addChecksum = (batchFile: any): any => {
return {
...batchFile,
meta: {
...batchFile.meta,
checksum: calculateChecksum(batchFile),
},
}
}
export * from './config' export * from './config'
export * from './etherscan' export * from './etherscan'
export * from './gnosis-safe-checksum'
export * from './install-drippie-config' export * from './install-drippie-config'
export * from './install-drippie-config-multisig'
import fs from 'fs'
import { task } from 'hardhat/config'
import { getChainId } from '@eth-optimism/core-utils'
import { isSameConfig, getDrippieConfig, addChecksum } from '../src'
task('install-drippie-config-multisig')
.addParam('safe', 'address of the Gnosis Safe to execute this bundle')
.addParam('outfile', 'where to write the bundle JSON file')
.setAction(async (args, hre) => {
if (!hre.ethers.utils.isAddress(args.safe)) {
throw new Error(`given safe is not an address: ${args.safe}`)
}
console.log(`connecting to Drippie...`)
const Drippie = await hre.ethers.getContractAt(
'Drippie',
(
await hre.deployments.get('Drippie')
).address
)
console.log(`loading local version of Drippie config for network...`)
const config = await getDrippieConfig(hre)
// Gnosis Safe transaction bundle.
const bundle: any = {
version: '1.0',
chainId: (await getChainId(hre.ethers.provider)).toString(),
createdAt: Date.now(),
meta: {
name: 'Transactions Batch',
description: '',
txBuilderVersion: '1.8.0',
createdFromSafeAddress: args.safe,
createdFromOwnerAddress: '',
},
transactions: [],
}
console.log(`generating transaction bundle...`)
for (const [dripName, dripConfig] of Object.entries(config)) {
console.log(`checking config for drip: ${dripName}`)
const drip = await Drippie.drips(dripName)
if (drip.status === 0) {
console.log(`drip does not exist yet: ${dripName}`)
console.log(`adding drip creation to bundle...`)
bundle.transactions.push({
to: Drippie.address,
value: '0',
data: null,
contractMethod: {
inputs: [
{ internalType: 'string', name: '_name', type: 'string' },
{
components: [
{
internalType: 'uint256',
name: 'interval',
type: 'uint256',
},
{
internalType: 'contract IDripCheck',
name: 'dripcheck',
type: 'address',
},
{ internalType: 'bytes', name: 'checkparams', type: 'bytes' },
{
components: [
{
internalType: 'address payable',
name: 'target',
type: 'address',
},
{ internalType: 'bytes', name: 'data', type: 'bytes' },
{
internalType: 'uint256',
name: 'value',
type: 'uint256',
},
],
internalType: 'struct Drippie.DripAction[]',
name: 'actions',
type: 'tuple[]',
},
],
internalType: 'struct Drippie.DripConfig',
name: '_config',
type: 'tuple',
},
],
name: 'create',
payable: false,
},
contractInputsValues: {
_name: dripName,
_config: JSON.stringify([
hre.ethers.BigNumber.from(dripConfig.interval).toString(),
dripConfig.dripcheck,
dripConfig.checkparams,
dripConfig.actions.map((action) => {
return [
action.target,
action.data,
hre.ethers.BigNumber.from(action.value).toString(),
]
}),
]),
},
})
} else if (!isSameConfig(dripConfig, drip.config)) {
console.log(`drip exists but local config is different: ${dripName}`)
console.log(`drips cannot be modified for security reasons`)
console.log(`please do not modify the local config for existing drips`)
console.log(`you can archive the old drip and create another`)
} else {
console.log(`drip is already installed`)
}
}
console.log(`writing bundle to ${args.outfile}...`)
fs.writeFileSync(args.outfile, JSON.stringify(addChecksum(bundle), null, 2))
})
...@@ -2,7 +2,7 @@ import { task } from 'hardhat/config' ...@@ -2,7 +2,7 @@ import { task } from 'hardhat/config'
import { LedgerSigner } from '@ethersproject/hardware-wallets' import { LedgerSigner } from '@ethersproject/hardware-wallets'
import { PopulatedTransaction } from 'ethers' import { PopulatedTransaction } from 'ethers'
import { DripConfig, getDrippieConfig } from '../src' import { isSameConfig, getDrippieConfig } from '../src'
task('install-drippie-config').setAction(async (args, hre) => { task('install-drippie-config').setAction(async (args, hre) => {
console.log(`connecting to ledger...`) console.log(`connecting to ledger...`)
...@@ -36,22 +36,6 @@ task('install-drippie-config').setAction(async (args, hre) => { ...@@ -36,22 +36,6 @@ task('install-drippie-config').setAction(async (args, hre) => {
console.log(`tx confirmed`) console.log(`tx confirmed`)
} }
const isSameConfig = (a: DripConfig, b: DripConfig): boolean => {
return (
a.dripcheck.toLowerCase() === b.dripcheck.toLowerCase() &&
a.checkparams === b.checkparams &&
hre.ethers.BigNumber.from(a.interval).eq(b.interval) &&
a.actions.length === b.actions.length &&
a.actions.every((ax, i) => {
return (
ax.target === b.actions[i].target &&
ax.data === b.actions[i].data &&
hre.ethers.BigNumber.from(ax.value).eq(b.actions[i].value)
)
})
)
}
console.log(`installing Drippie config file...`) console.log(`installing Drippie config file...`)
for (const [dripName, dripConfig] of Object.entries(config)) { for (const [dripName, dripConfig] of Object.entries(config)) {
console.log(`checking config for drip: ${dripName}`) console.log(`checking config for drip: ${dripName}`)
......
...@@ -6,11 +6,19 @@ that maintains 1:1 compatibility with Ethereum. ...@@ -6,11 +6,19 @@ that maintains 1:1 compatibility with Ethereum.
## Specification Contents ## Specification Contents
- [Glossary](glossary.md) - [Introduction](introduction.md)
- [Overview](overview.md)
- [Deposits](deposits.md) - [Deposits](deposits.md)
- [Withdrawals](withdrawals.md)
- [Execution Engine](exec-engine.md) - [Execution Engine](exec-engine.md)
- [L2 Output Root Proposals](proposals.md) - [L2 Output Root Proposals](proposals.md)
- [Rollup Node](rollup-node.md) - [Rollup Node](rollup-node.md)
- [Rollup Node P2p](rollup-node-p2p.md)
- [Guaranteed Gas Market](guaranteed-gas-market.md)
- [Messengers](messengers.md)
- [Bridges](bridges.md)
- [Predeploys](predeploys.md)
- [Glossary](glossary.md)
## Design Goals ## Design Goals
......
...@@ -144,7 +144,7 @@ func (c Config) WithoutDB() string { ...@@ -144,7 +144,7 @@ func (c Config) WithoutDB() string {
) )
} }
// sslMode retuns "enabled" if EnableSSL is true, otherwise returns "disabled". // sslMode returns "enabled" if EnableSSL is true, otherwise returns "disabled".
func (c Config) sslMode() string { func (c Config) sslMode() string {
if c.EnableSSL { if c.EnableSSL {
return "require" return "require"
......
...@@ -407,7 +407,7 @@ func (d *Driver) processPendingTxs(ctx context.Context) error { ...@@ -407,7 +407,7 @@ func (d *Driver) processPendingTxs(ctx context.Context) error {
return errors.New("unable to find receipt for any pending tx") return errors.New("unable to find receipt for any pending tx")
} }
// Useing the block number, load the header so that we can get accurate // Using the block number, load the header so that we can get accurate
// timestamps for the disbursements. // timestamps for the disbursements.
header, err := d.cfg.L2Client.HeaderByNumber(ctx, receipt.BlockNumber) header, err := d.cfg.L2Client.HeaderByNumber(ctx, receipt.BlockNumber)
if err != nil { if err != nil {
......
...@@ -1614,10 +1614,10 @@ ...@@ -1614,10 +1614,10 @@
command-exists "^1.2.9" command-exists "^1.2.9"
ts-interface-checker "^0.1.9" ts-interface-checker "^0.1.9"
"@foundry-rs/hardhat-forge@^0.1.7": "@foundry-rs/hardhat-forge@^0.1.9":
version "0.1.7" version "0.1.9"
resolved "https://registry.yarnpkg.com/@foundry-rs/hardhat-forge/-/hardhat-forge-0.1.7.tgz#54f3224d426811cbb2dee5b0516aa593d553a856" resolved "https://registry.yarnpkg.com/@foundry-rs/hardhat-forge/-/hardhat-forge-0.1.9.tgz#43144d349b0d9ea00bcad28827c7f03187458c5a"
integrity sha512-6aDXmzy4V4NyOeclTrskrKFf5A0hOx0xDdjm8e8qAzFdC3Y0HlXdr66uUFBVHMsQbWLRVf6IzqeISzCcc6ZJ2g== integrity sha512-y1k9bMV9LNgNnxvC7O/P2HPk8eNN2Jpan3fDl9/gii7NCT8J5028hABsCIEwFq4/4mMybJWu2KsHYDjZi8NGZQ==
dependencies: dependencies:
"@foundry-rs/easy-foundryup" "^0.1.3" "@foundry-rs/easy-foundryup" "^0.1.3"
"@nomiclabs/hardhat-ethers" "^2.0.0" "@nomiclabs/hardhat-ethers" "^2.0.0"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment